Skip to content

fix(shader): emit the fault record function without DontInline - #7942

Open
erm14254 wants to merge 1 commit into
boykopovar:mainfrom
erm14254:fix/shader-fault-record-no-dontinline
Open

erm14254 wants to merge 1 commit into
boykopovar:mainfrom
erm14254:fix/shader-fault-record-no-dontinline

Conversation

@erm14254

@erm14254 erm14254 commented Oct 19, 2026 •

Copy link
Copy Markdown

What

NVIDIA driver 597.16 (RTX PRO 6000 Blackwell, Windows) crashes in its compiler at nvgpucomp64.dll+0x28072a1 while creating a compute pipeline of Code Violet. spirv-reduce, kept to that crash offset, leaves a selection steered by a ballot whose one arm calls record_bda_fault, a DontInline function, and whose other arm holds another ballot. The reduced module and the full one compile once the function is declared without the control or with Inline, so the function is emitted without DontInline and the driver inlines or calls it as it sees fit. The other DontInline helpers keep the control. The debt entry in docs/dev/debt/shader.md and the NVIDIA note in docs/user/USAGE.md record the finding; the test in agc_shader_memory now expects the fault function without the control.

Tested

On main 00d7e61, where record_bda_fault is still declared DontInline: Windows 11 (10.0.22631), RTX PRO 6000 Blackwell Workstation Edition, NVIDIA 597.16: agc_shader_memory, agc_driver_bda_device, agc_driver_bda_span_reads, agc_driver_guarded_null_pointer, agc_driver_image_table, agc_device_fault and agc_formatted_buffer_once pass.

Before the rebase, on d92a8da with the same GPU and driver, the reduced module and the full compute module compile through agc_compute_pipeline_replay with this, and Code Violet (PPSA26528) no longer stops in nvgpucomp64.dll; on Linux, lavapipe, the same seven tests pass. Plain main 0615cd2 still stopped at nvgpucomp64.dll+0x28072a1 on 2026-10-16 (#6257). The title has not been run on the rebased branch yet; I'll add that result in a comment.

The reduced SPIR-V module is attached below.

pr4-reduced-module.zip

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA26528 Code Violet (PPSA26528) #6256
  • GPUs tested: NVIDIA RTX PRO 6000 Blackwell Workstation Edition, driver 597.16, Windows 11; lavapipe on Linux
  • AI-assisted: yes

🤖 Generated with Claude Code

NVIDIA driver 597.16 (RTX PRO 6000 Blackwell, Windows) crashes in its
compiler at nvgpucomp64.dll+0x28072a1 on a PPSA26528 compute module.
spirv-reduce, kept to that crash offset, leaves a selection steered by a
ballot whose one arm calls record_bda_fault, a DontInline function, and
whose other arm holds another ballot. The reduced module and the full one
compile with the function declared without the control or Inline, so the
function is emitted without DontInline; the driver inlines or calls it as
it sees fit.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019hfwvntiwabeqdZ6avJssk
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Oct 19, 2026
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 5426 docs/dev/debt/shader.md L171

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 5021 docs/dev/debt/shader.md
docs/user/USAGE.md
PR 5371 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 5925 docs/user/USAGE.md
PR 5941 docs/dev/debt/shader.md
PR 6009 docs/dev/debt/shader.md
PR 6011 docs/dev/debt/shader.md
PR 6171 docs/user/USAGE.md
PR 6235 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 6280 docs/dev/debt/shader.md
PR 6290 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 6412 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 6488 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 6586 docs/user/USAGE.md
PR 6604 docs/dev/debt/shader.md
PR 6645 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 6788 docs/user/USAGE.md
PR 6879 docs/dev/debt/shader.md
PR 6924 docs/dev/debt/shader.md
docs/user/USAGE.md
PR 6946 docs/user/USAGE.md
PR 6947 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/user/USAGE.md
PR 6977 docs/dev/debt/shader.md
PR 7223 docs/dev/debt/shader.md
PR 7410 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 7484 docs/dev/debt/shader.md
PR 7642 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/user/USAGE.md
PR 7684 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 7689 core/shader/recompiler/SpirvBackend/src/SpirvBdaFault.cpp
PR 7800 docs/user/USAGE.md
PR 7816 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 7918 docs/user/USAGE.md
PR 8077 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 8489 docs/dev/debt/shader.md
PR 8564 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md

@erm14254

Copy link
Copy Markdown
Author

Manual overlap review for the list above, against each pull request's current head. None of them changes the lines this PR changes.

No overlap, no Depends on.

@github-actions github-actions Bot added shader core/shader docs agc libSceAgc* labels Oct 19, 2026
@DavidAmsellem

Copy link
Copy Markdown
Contributor

First AMD-on-Linux (RADV) run of this PR. Merged onto main 8d5d4df96 (clean merge), built in full and compared with the same main, on the same machine.

AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release.

Full suite (ANYPS5_REQUIRE_VULKAN=1 ctest -j8) at 6474695df: 1638/1640 with this PR, against 1638/1640 on main. The two failures are the same on both, so this PR adds none: agc_driver_image_table_vouched_lookups (#7766, fixed by #7916) and agc_driver_guest_memory_lifetime (#7784).

Comparing the JUnit output with main: this PR adds no ctest entry, and none is skipped or removed.

This checks correctness only; I did not measure performance.

GPUs tested: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 / kernel 7.0.0-38

AI-assisted: yes

@oneandonlydean oneandonlydean self-assigned this Oct 20, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

@erm14254 DontInline on record_bda_fault came from f7d4fba (#1043) as a pipeline-creation fix: with the fault recording copied into every read site, one compute program reached about a million SPIR-V words and ~95 s in vkCreateComputePipelines (PPSA26344's ~835k-word variants took 45 s each). Without the hint the module stays small, but any driver may now inline the function at every call site, which is the cost that change was avoiding. The change also applies to every driver, not only 597.16. Could you add the vkCreateComputePipelines time of a large BDA program before and after (for example through agc_compute_pipeline_replay) on NVIDIA and on AMD, or limit the change to the driver that crashes, as the other driver workarounds do?

This branch has not been deployed

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

Labels

agc libSceAgc* docs shader core/shader unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants