Skip to content

cpp-migration 40365770: native _hardware tests crash (0xC0000005) on an RX 9070 XT; wave_request expects a different refusal message #2915

Done

Description

@MasterDomino

Target branch cpp-migration, commit 40365770. @R0Y00, these are the native tests on an AMD adapter. Six _hardware tests crash with an access violation, and one fails on a refusal message that does not depend on the adapter.

Environment: Windows 11 build 26300.9974, AMD Radeon RX 9070 XT (RDNA 4), driver 32.0.32029.2010, MSVC 19.44.35221, Windows SDK 10.0.26100 DXC, D3D12 debug layer not enabled. Clean configure.

cmake --preset release
cmake --build --preset release
ctest --preset release --no-tests=error -j 6 --timeout 300 -R '^native_'

25 tests: 17 passed, 1 skipped (77, native_comparison_pso_warp), 7 failed. The same 7 fail with --preset dev. Every _warp test passed.

To get the exit codes, I ran each failing check with subprocess.run wrapped to log any child that exits non-zero:

test failing child exit code
native_adjacent_srv_hardware native_store_replay.exe ... 0 append.bin --direct 0xC0000005
native_indexed_atomic_hardware native_store_replay.exe ... 0 result.bin --direct 0xC0000005
native_mtbuf_hardware native_store_replay.exe 0xC0000005
native_scalar_lds_hardware native_store_replay.exe 0xC0000005
native_dpp_mirror_hardware native_store_replay.exe 0xC0000005
native_graphics_wqm_hardware offscreen_check.exe ... 8 2 expected.bin 0xC0000005
native_wave_request_hardware see below —

None of the crashing children writes anything to stdout or stderr before it exits. What they share is a pipeline built from DXIL produced by the direct frontend, run on this driver. The same frontend passes on WARP: native_lds_warp, native_buffered_vertex_warp, native_sampled_pixel_warp and the PSO checks. Hypothesis, not tested: the fault is in the driver while it creates or runs that pipeline. I could not get a stack. This host has no cdb, and tools/startup/debug_launch.py cannot pass arguments to the program it starts. If a run with the D3D12 debug layer forced on, or a specific dump, would help, tell me which and I will capture it.

native_wave_request_hardware does not depend on the GPU. At tests/native_wave_request_check.py:191, the request with 0xffffffff inserted is refused as intended: compile_dxil.exe exits 1 and writes no bad.cso. However, stderr is unknown gfx1013 instruction format at byte 100, and the assertion expects "unsupported instruction". The same mismatch should show on any host that reaches that line.

AI-assisted; the commands above were run locally.

Activity

  1. added
    help wanted
    on Nov 26, 2026
  2. Its3rr0rsWRLD commented on Nov 26, 2026

    @Its3rr0rsWRLD
    Contributor

    Results from an NVIDIA adapter on cpp-migration at 40365770. The branch tip was still 40365770 when I ran this.

    Environment: Windows 11 build 26300.9974, NVIDIA GeForce RTX 4070 Ti (driver 610.88, WDDM 32.0.16.1088), MSVC 19.51.36257 (toolset 14.51.36231), Windows SDK 10.0.26100 DXC. Clean configure with --preset release.

    cmake --preset release
    cmake --build --preset release
    ctest --preset release --no-tests=error -j 2 --timeout 300 -R '^native_'

    25 tests: 23 passed, 1 skipped (77, native_comparison_pso_warp, WARP reports 4..4 lanes), 1 failed.

    test RX 9070 XT (this issue) RTX 4070 Ti
    native_adjacent_srv_hardware 0xC0000005 passed
    native_indexed_atomic_hardware 0xC0000005 passed
    native_mtbuf_hardware 0xC0000005 passed
    native_scalar_lds_hardware 0xC0000005 passed
    native_dpp_mirror_hardware 0xC0000005 passed
    native_graphics_wqm_hardware 0xC0000005 passed
    native_wave_request_hardware failed, line 191 failed, line 191 (same assertion)
    the other 18 passed or skipped passed or skipped

    So the six crashes do not reproduce here. The wave_request failure does.

    Debug layer. I ran the five native_store_replay checks with the D3D12 debug layer and GPU-based validation on (see the second commit below). Their 21 replays all passed and raised only warning 1328 (CreateCommittedResource ignores the COPY_DEST initial state of a buffer). offscreen_check already enables the debug layer when it is available. On this host, the 13 draws of native_graphics_wqm_hardware each reported debug_errors=0 debug_warnings=0, and so did the one native_dpp_mirror_hardware draw whose output the check prints.

    Reading native_store_replay --direct. I found nothing that would fault on every driver. The root signature, the heap layout and the order of NativeComputePipeline::bind agree (SRV table, UAV table, constants, one constant pair per indexed atomic view). Every UAV goes through native_buffer_store_view, including the truncated-size control. Each window has 8 guard elements on each side. Every HRESULT is checked, so a failed create throws and exits 1 instead of crashing.

    What the six have in common. All of them run DXIL from the direct frontend on a hardware adapter. On the AMD run, none of the passing tests does that: native_lds_hardware compiles HLSL through DXC, the _warp tests run on WARP, and native_wave_request_hardware fails before its GPU half starts. The direct IR passes the SDK validator, but it is not shaped like DXC output: it has one alloca per guest register, it reads registers that were never written (the inactive-lane merges), and constant arithmetic such as mul i32 0, 32 is left unfolded. DXC never emits these forms. Guess, not tested: the AMD driver's shader compiler faults on one of them while it creates the pipeline. That would fit the empty output, because the children's stdout was fully buffered on a pipe.

    Ask. With the second commit, please run one failing check on the RX 9070 XT with the variable set, for example:

    $env:X2W_REPLAY_DEBUG_LAYER = 'gbv'
    ctest --preset release -V -R '^native_mtbuf_hardware$'

    The child now prints stage=pipeline, stage=views, stage=submit and stage=readback on stderr, along with any debug-layer message as it is raised, and its stdout is unbuffered. If the last line before the crash is stage=pipeline, the fault is inside CreateComputePipelineState.

    native_wave_request_hardware. The fix belongs in the frontend, not in the test. decode() in src/gfx1013_compute_native.cpp calls the shared gfx1013::instruction() before it classifies the word. For 0xffffffff that decoder throws a plain std::runtime_error, so the frontend's own refuse(pc, "unsupported instruction ...") is never reached. Every other refusal in this frontend is an UnsupportedComputeShader with a native compute +0x<pc>: prefix, and the check, which was added in the same commit, expects exactly that. The fix wraps the call and turns the decoder's error into a refusal at the word's offset, keeping the decoder's reason:

    native compute +0x64: unsupported instruction 0xffffffffu (unknown gfx1013 instruction format at byte 100)
    

    The check now asserts the offset and the word. On the RTX 4070 Ti, native_wave_request_hardware passes with the fix, and so do the other 23 native_ tests. On the RX 9070 XT this test will now reach its GPU half, which runs direct-frontend DXIL too, so it may hit the same crash there.

    Proposed fix, on a branch from 40365770 (not pushed yet):

    1. native: refuse undecodable words as unsupported instructions: src/gfx1013_compute_native.cpp (a wrapper around the shared decoder call in decode()) and tests/native_wave_request_check.py:191.
    2. tests: opt-in D3D12 debug layer and stage markers in native_store_replay: unbuffered stdout, plus X2W_REPLAY_DEBUG_LAYER=1|gbv. Without the variable, nothing changes apart from the buffering.

    The shared decoder is also called directly by the entry == 36 capture-prefix scan in translate_program and by read_raw_graphics. Those two calls still throw the plain error. I left them alone to keep the change small. I can route them through the same wrapper if you prefer.

    Prepared by Claude Opus 5.5

  3. SimSalabimse commented on Nov 26, 2026

    @SimSalabimse
    Contributor

    NVIDIA result on cpp-migration 40365770: none of the six access violations happens on an RTX 4070 Ti. Only native_wave_request_hardware fails, at the same assertion you describe.

    Environment: Windows 11 25H2 (26200), MSVC 19.42, NVIDIA GeForce RTX 4070 Ti, driver 621.35 (32.0.16.2135). Clean worktree at 40365770206d355160f364495cd9a72be2c7df8e, fresh out/pe-env, dev preset (not release). Tests run serially.

    Commands

    cmake --preset dev
    cmake --build --preset dev
    ctest --preset dev --no-tests=error -R "^native_" --output-on-failure -j 1 --timeout 300
    

    Result (measured, 2 runs, same both times): 25 tests: 23 passed, 1 skipped (native_comparison_pso_warp), 1 failed. ctest exit 8.

    • Passed on hardware: native_adjacent_srv_hardware, native_indexed_atomic_hardware, native_mtbuf_hardware, native_scalar_lds_hardware, native_dpp_mirror_hardware and native_graphics_wqm_hardware. These are the six that crash with 0xC0000005 on the RX 9070 XT. So the crash does not reproduce on this NVIDIA driver, which fits your hypothesis that it depends on the driver or adapter. I did not test that hypothesis further.
    • Failed: native_wave_request_hardware, 0.25 s:
    File "tests/native_wave_request_check.py", line 191, in main
        assert result.returncode and "unsupported instruction" in result.stderr and not (work / "bad.cso").exists()
    AssertionError
    

    That is the same line as on your machine, so this failure does not depend on the adapter.

    AI-Assisted

  4. thepatrickworld commented on Nov 26, 2026

    @thepatrickworld
    Contributor

    Independent AMD RDNA 4 result on 40365770: the six native_*_hardware crashes are one null read inside amdxc64.dll while it compiles the pipeline

    Not a code change; measurements only. This reproduces the six access violations on a second host and adds what nobody has posted yet: the fault site, and a control that ties the outcome to the PSO bytecode.

    Environment

    • Windows 11 25H2, build 26200.9974 (kernel reports 10.0.26200.9974). Not the reporter's host (26300.9974).
    • AMD Radeon RX 9070 XT, driver package 32.0.32029.2010 — the same package version as the AMD report above.
    • amdxc64.dll from …\FileRepository\u0206168.inf_amd64_1fdbc918cb04eef5\B026806: version 8.18.10.0514, /Brepro ID 81EB749E, CheckSum 0890D254, SizeOfImage 0x0878C000, SHA-256 EF70BD34D70AAE8D3C815CEE1044D7D75FFC7D10FB64B80CBF6F6F322461348C.
    • MSVC BuildTools 2022, toolset 14.44.35207; Windows SDK 10.0.26100 DXC; preset dev (CMAKE_BUILD_TYPE=Debug), clean worktree at 40365770.
    • The D3D12 debug layer is not installed on this host (d3d12SDKLayers.dll absent from System32), so no run below produced validation output.

    What I ran

    cmake --preset dev "-DINTAKE_PYTHON=…/out/pe-env/Scripts/python.exe"
    cmake --build --preset dev
    ctest --preset dev --no-tests=error -R "^native_" -j 1 --timeout 300
    

    25 tests: 17 passed, 1 skipped, 7 failed. The skip is native_comparison_pso_warp. The failures:

    • 0xC0000005: native_scalar_lds_hardware, native_adjacent_srv_hardware, native_mtbuf_hardware, native_indexed_atomic_hardware, native_dpp_mirror_hardware, and native_graphics_wqm_hardware (the last one as an empty child stdout/stderr, AssertionError: ('', '') at tests/native_graphics_wqm_check.py:98);
    • native_wave_request_hardware: AssertionError at tests/native_wave_request_check.py:191, the same line as both NVIDIA reports, so this failure does not depend on the adapter. It is a separate defect from the crash below and is not counted in the six.

    So the six access violations listed in this issue reproduce here, six for six, on the same driver package version (32.0.32029.2010) and a different OS build. I did not compare the reporter's UMD file version with the 8.18.10.0514 measured here, so "same driver" means the package version string, not a proven identical binary.

    Where the exception is raised

    I set LocalDumps (DumpType=2) on native_store_replay.exe and re-ran the five compute entries with it in place, plus ctest --preset dev --no-tests=error -R "^native_mtbuf_hardware$" -V alone: the fixture dies with returned non-zero exit status 3221225477 (0xC0000005), and each of the five crashing compute entries left a dump. All of them carry the same exception record:

    ExceptionAddress: 00007ffb`55bc2cb7   (amdxc64 base 00007ffb`54110000 → RVA 0x1ab2cb7)
    ExceptionCode:    c0000005
    Attempt to read from address 0000000000000040
    00007ffb`55bc2cb7  48 8b 41 40    mov rax,qword ptr [rcx+40h]     rcx = 0
    

    The stack reaches it through the UMD entry of the versioned constructor:

    native_store_replay!wmain+0x5cd
    native_store_replay!x2w::create_native_compute_pipeline+0xef4
    D3D12Core!CDevice::CreateComputePipelineState+0x8c
    D3D12Core!CDevice::CreatePipelineStateImpl+0x753
    D3D12Core!CDevice::CreateLayeredChild+0x396
    D3D12Core!CLayeredObject<CPipelineState>::CreateInstance+0x68
    D3D12Core!CPipelineState::FinalConstruct+0x41d
    D3D12Core!CDevice::VersionedCreatePipelineState+0x54
    D3D12Core!TableFunctionTraits<…>::Call+0x4d    ← interface thunk into the UMD
    [22 frames inside amdxc64, the innermost containing the fault site]
    

    The symbol names cdb prints inside amdxc64 are not usable — !analyze -v itself answers amdxc64.dll!Unknown and FAILURE_BUCKET_ID: NULL_CLASS_PTR_READ_c0000005_amdxc64.dll!Unknown — so the identification rests only on module + RVA + instruction bytes, not on any function name.

    The stage markers proposed in the second comment on this issue would end at stage=pipeline; the dump narrows it one level further, to a single instruction inside the UMD's pipeline compiler. The translator's root signature had already been created and accepted when the fault occurs.

    The sixth entry reaches the same site from another binary. With the same LocalDumps key on offscreen_check.exe, native_graphics_wqm_hardware faults at the same address 00007ffb55bc2cb7 with the same instruction, through offscreen_check!check_startup_flat_param+0x4b8 → D3D12Core!CDevice::CreateGraphicsPipelineState+0xa4 → the same CPipelineState::FinalConstruct. Same translator, different API path — this is not an independent implementation.

    What decides the fault

    A local, unpushed instrumentation of src/native_compute_pipeline.cpp replaced the bytecode handed to CreateComputePipelineState when X2W_PROBE_DXIL is set; the marker, the root signature the translator builds, the bindings and the device are untouched. Nine runs, three arms, three rounds interleaved, with %LOCALAPPDATA%\AMD\DxcCache and %LOCALAPPDATA%\D3DSCache purged before every arm:

    arm container handed to the PSO result
    emitter's own container 16708 bytes, sha256 ed64548bc3641269… 0xC0000005, no output file — 3/3
    [numthreads(64,1,1)] void main() {} 2060 bytes, sha256 f8cf1cd3aeb608a3… rc=0, output file written — 3/3
    baseline, no substitution (compiled in-process) 0xC0000005 — 3/3

    Within these nine runs the outcome changes when, and only when, the container bytes change. The trivial shader touches no resource, so its rc=0 shows the same root signature, heap layout and command list reach the end; what it does not show is that any property of the emitter's container has been isolated. This control covers the compute path only — I did not replay the graphics entry with a substituted container. Which property is at fault is not localized: three minimal cs_6_6 shaders compiled by dxc and substituted the same way — WaveActiveBallot + WaveGetLaneIndex, half→float, and raw-buffer load/store with GetDimensions — all return 0. That rules out those constructs taken in isolation; it does not rule out their combinations, nor whatever DPP/MTBUF/LDS/atomics forms the six crashing containers actually share.

    Two context points:

    • the crashing container was accepted by Microsoft's DXIL validator inside the process that produced it — src/shader_dxil_compiler.cpp:140-146 calls IDxcValidator::Validate(blob, DxcValidatorFlags_InPlaceEdit) and re-reads the status. The test harnesses compile into a TemporaryDirectory, so these are cold-cache runs where validation ran. This rules out malformed DXIL as the explanation; it does not establish that a driver must accept a conforming container. On the substituted arms the bytes rather than the compiler reach the PSO, so validation does not cover them.
    • native_lds_hardware (native_lds_gpu.exe hardware … tests/native_lds_gpu.hlsl) compiles the HLSL with DXC at cs_6_0, creates a compute PSO and dispatches on this card, and passes. Its shader does different work than native_scalar_lds_hardware and targets an older shader model, so this is not a controlled A/B; it only shows that this adapter does create compute pipelines from DXC output.

    Limits

    • One adapter, one driver package version, so nothing here says whether this is a regression.
    • dev preset only; I did not run release.
    • The debug layer is missing from this host — d3d12SDKLayers.dll ships with the "Graphics Tools" optional feature, which is not installed — so "no validation message" is a host configuration, not a clean bill.
    • Three rounds per arm are not a rate estimate: no run was intermittent here, but n=3 says nothing about flakiness.
    • The substituted containers differ from the emitter's by size as well (2060 vs 16708 bytes) and the trivial one was compiled by dxc.exe rather than by the in-process compiler, so size and container parts are not matched.
    • The cache purge could not delete two .parc entries in AMD\DxcCache that another process held open; 245 entries and the whole D3DSCache were cleared.
    • --direct on WARP was not exercised: native_store_replay takes no adapter selector, so the software adapter cannot be forced to give a verdict on the same container.
    • Measured at 40365770. The branch tip has since moved to cd752a8c, whose only difference is shader: draw a per-vertex VCC across a vertex-stage join (Refs #2906) #2914 (fixture, note and CMake fragment — no source change), so the measured code path is the same.
    • The instrumentation is five lines and is not published; the tree was restored afterwards (git status --porcelain --untracked-files=no empty, HEAD = 40365770). Say the word and I will post the patch or the failing container.

    AI-assisted.

  5. consolelogkyo commented on Nov 26, 2026

    @consolelogkyo
    Contributor

    Claiming the investigation and fix for the six native_*_hardware 0xC0000005 (amdxc64.dll) pipeline-creation crashes on cpp-migration (ee76dfa8).

    • Environment: Windows 11, AMD Radeon RX 9070 XT (1002:7550, driver 32.0.32029.2010) with the D3D12 debug layer installed, plus in-box WARP (1414:008c).
    • Scope: isolate the DXIL container / bitcode difference in src/dxil_module.h / src/shader_dxil_compiler.cpp (and the direct emitters) that triggers the null dereference inside amdxc64.dll during CreateComputePipelineState and CreateGraphicsPipelineState, fix the emitter with a container/IR regression control, and verify all six native_*_hardware tests on RX 9070 XT and WARP. Leaving the native_wave_request_hardware undecodable-word refusal wrapper to @Its3rr0rsWRLD so our branches do not overlap.

    AI-assisted.

  6. consolelogkyo commented on Nov 26, 2026

    @consolelogkyo
    Contributor

    Opened #2932 against cpp-migration for the AMD 0xC0000005 (amdxc64.dll) pipeline-creation crashes:

    • Root cause: re-assembling dxc.exe -T ps_6_6 output vs DxilModule output through IDxcAssembler::AssembleToContainer and IDxcValidator::Validate isolated the crash to missing !llvm.ident module metadata (amdxc64.dll 8.18.10.0514 calls llvm::Module::getNamedMetadata("llvm.ident") and dereferences NamedMDNode* at +0x40 without a null check, whereas IDxcValidator treats !llvm.ident as optional).
    • Fix & verification: emitted !llvm.ident = !{!<id>} (!{!"x2w"}) in DxilModule::finish_compute (src/dxil_module.h) and x2w::direct_gfx1013_constant_pixel (src/gfx1013_pixel.cpp). All seven direct-DXIL _hardware tests (native_scalar_lds_hardware, native_adjacent_srv_hardware, native_mtbuf_hardware, native_indexed_atomic_hardware, native_dpp_mirror_hardware, native_graphics_wqm_hardware, native_graphics_vertex_vcc_join_hardware) plus native_dxil_llvm_ident_{controls,warp,hardware} now pass (28/28 non-skipped ^native_ tests excluding native_wave_request_hardware, which tests: expect the decoder's refusal for the invalid word in native_wave_request #2928 covers) on AMD Radeon RX 9070 XT (1002:7550, driver 32.0.32029.2010) and Microsoft Basic Render Driver (1414:008c, driver 10.0.26100.9818) with debug_errors=0 debug_warnings=0.

    AI-assisted.

  7. MasterDomino commented on Nov 26, 2026

    @MasterDomino
    CollaboratorAuthor

    Update from the reporter's host after #2928 was merged into cpp-migration as e4523d97.

    I can run #2932 on this host, which is the original crashing adapter.

    AI-assisted.

  8. MasterDomino commented on Nov 26, 2026

    @MasterDomino
    CollaboratorAuthor

    Both parts are fixed on cpp-migration:

    Final run on cpp-migration e97c5c7c, on this issue's original host (Windows 11 26300.9974, RX 9070 XT, driver 32.0.32029.2010, release): ctest --preset release --no-tests=error -R '^native_' gives 32 tests, 31 passed and 1 skipped (77, native_comparison_pso_warp). All 13 _hardware tests pass.

    Two suggestions from this thread remain open:

    • @Its3rr0rsWRLD's frontend wrapper, which reports undecodable words as unsupported instruction ...;
    • a native check for the frontend's lowering refusal (unsupported opcode, for example 0x64000501).

    Neither is needed to close this, and either can come as a follow-up.

    AI-assisted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions