Skip to content

[Metal][DXC] Concurrent writing of uint4 components test failure #452

@inbelic

Description

@inbelic

As illustrated in the ComponentDataRace test, Metal fails to correctly copy over the data when written concurrently across waves:

2025-09-24T18:54:33.7663560Z ******************** TEST 'OffloadTest-mtl :: WaveOps/ComponentDataRace.test' FAILED ********************
2025-09-24T18:54:33.7673620Z Exit Code: 1
2025-09-24T18:54:33.7673970Z 
2025-09-24T18:54:33.7674170Z Command Output (stdout):
2025-09-24T18:54:33.7674420Z --
2025-09-24T18:54:33.7674640Z Using Metal API
2025-09-24T18:54:33.7674870Z Created compute commands.
2025-09-24T18:54:33.7675090Z 
2025-09-24T18:54:33.7675220Z --
2025-09-24T18:54:33.7676900Z Command Output (stderr):
2025-09-24T18:54:33.7677860Z --
2025-09-24T18:54:33.7679250Z /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin/split-file /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/OffloadTest/test/WaveOps/ComponentDataRace.test /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/WaveOps/Output/ComponentDataRace.test.tmp # RUN: at line 64
2025-09-24T18:54:33.7681620Z + /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin/split-file /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/OffloadTest/test/WaveOps/ComponentDataRace.test /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/WaveOps/Output/ComponentDataRace.test.tmp
2025-09-24T18:54:33.7684220Z "/Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/DXC/build/bin/dxc-3.7" -metal -T cs_6_5 -Fo /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/WaveOps/Output/ComponentDataRace.test.tmp.o /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/WaveOps/Output/ComponentDataRace.test.tmp/source.hlsl # RUN: at line 65
2025-09-24T18:54:33.7686860Z + /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/DXC/build/bin/dxc-3.7 -metal -T cs_6_5 -Fo /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/WaveOps/Output/ComponentDataRace.test.tmp.o /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/WaveOps/Output/ComponentDataRace.test.tmp/source.hlsl
2025-09-24T18:54:33.7699530Z /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin/offloader -debug-layer /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/WaveOps/Output/ComponentDataRace.test.tmp/pipeline.yaml /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/WaveOps/Output/ComponentDataRace.test.tmp.o # RUN: at line 66
2025-09-24T18:54:33.7702360Z + /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin/offloader -debug-layer /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/WaveOps/Output/ComponentDataRace.test.tmp/pipeline.yaml /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/WaveOps/Output/ComponentDataRace.test.tmp.o
2025-09-24T18:54:33.7704490Z 2025-09-24 13:54:33.574 offloader[39126:172017742] *** -[NSAutoreleasePool addObject:]: Do not use this instance method on specific pools -- just use -autorelease instead.
2025-09-24T18:54:33.7704960Z Test failed: ExpectedOut
2025-09-24T18:54:33.7705130Z Comparison Rule: BufferExact
2025-09-24T18:54:33.7705280Z Expected:
2025-09-24T18:54:33.7705380Z ---
2025-09-24T18:54:33.7705490Z Name:            ExpectedOut
2025-09-24T18:54:33.7705640Z Format:          UInt32
2025-09-24T18:54:33.7705760Z Channels:        4
2025-09-24T18:54:33.7705890Z Data:            [ 1, 2, 3, 4 ]
2025-09-24T18:54:33.7706040Z OutputProps:
2025-09-24T18:54:33.7706510Z   Height:          0
2025-09-24T18:54:33.7706640Z   Width:           0
2025-09-24T18:54:33.7706760Z   Depth:           0
2025-09-24T18:54:33.7706880Z ...
2025-09-24T18:54:33.7706970Z Got:
2025-09-24T18:54:33.7707060Z ---
2025-09-24T18:54:33.7707160Z Name:            Out
2025-09-24T18:54:33.7707290Z Format:          UInt32
2025-09-24T18:54:33.7707410Z Channels:        4
2025-09-24T18:54:33.7707540Z Data:            [ 1, 0, 0, 0 ]
2025-09-24T18:54:33.7707680Z OutputProps:
2025-09-24T18:54:33.7707790Z   Height:          0
2025-09-24T18:54:33.7708050Z   Width:           0
2025-09-24T18:54:33.7708170Z   Depth:           0
2025-09-24T18:54:33.7708290Z ...
2025-09-24T18:54:33.7708450Z Full Hex 64bit representation of Expected Buffer Values:
2025-09-24T18:54:33.7708670Z [ 0x1, 0x2, 0x3, 0x4 ]
2025-09-24T18:54:33.7708840Z Full Hex 64bit representation of Actual Buffer Values:
2025-09-24T18:54:33.7709890Z [ 0x1, 0x0, 0x0, 0x0 ]
2025-09-24T18:54:33.7710000Z 
2025-09-24T18:54:33.7710010Z 
2025-09-24T18:54:33.7710050Z --
2025-09-24T18:54:33.7710120Z 
2025-09-24T18:54:33.7710160Z ********************

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions