gpu/pipeline: reject empty descriptor source joins in bound_view_stores (D3D12-GPU-BOUND-STORES-EMPTY-LEAVES) #2892
Open
github-bot
wants to merge 1 commit from
github-bot/gh-2892 into main
AGit
pull from: github-bot/gh-2892
merge into: github:main
github:main
github:perf/darner-title-priority-ceiling
github:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
github:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
github:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
github:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
github:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
github:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github:fix/runtime-test-conservative-fixtures
github:ci/shard-semantic-linux
github:docs/fg-limit-fps-switch
github:fix/runtime-test-fixture-paths
github:fix/runtime-test-fixture-readers
github:fix/read-file-hard-link
github:fix/book-slot-heap-never-read
github:fix/depth-resolve-spv-path
github:fix/indirect-unused-batched
github:gh-pr/3358/base
github:fix/xmem-refusal-diagnostics
github:gh-pr/3357/base
github:ci/shorten-ci-time
github:fix/alias-later-queued-submissions
github:claude/gallant-sagan-aamatr
github:gh-pr/3342/base
github:gh-pr/3341/base
github:d3d12/agility-sdk-621
github:gh-pr/3293/base
github:gh-pr/3319/base
github:gh-pr/3318/base
github:gh-pr/3315/base
github:gh-pr/3313/base
github:gh-pr/3314/base
github:claude/fervent-curie-m19lnr
github:gh-pr/3216/base
github:gh-pr/3272/base
github:gh-pr/3276/base
github:gh-pr/3279/base
github:gh-pr/3257/base
github:gh-pr/3258/base
github:gh-pr/3271/base
github:codex/skip-no-hit-ray-passes
github:gh-pr/3230/base
github:gh-pr/3266/base
github:gh-pr/3247/base
github:gh-pr/3246/base
github:gh-pr/3244/base
github:claude/sharp-sagan-1jqnp3
github:t3/preserve-fsr-sdk-restart-path
github:t3/propagate-host-failure-hresult
github:t3/launcher-custom-parameters
github:t3/series-x-2160-startup
github:codex/d3d12-uncapped-simulation
github:ci/less-to-run
github:perf/native-compute-shader-forms
github:claude/blissful-franklin-ukp7ag
github:codex/full-precompile-default
github:gh-pr/3166/base
github:gh-pr/3148/base
github:gh-pr/3138/base
github:gh-pr/3106/base
github:gh-pr/3057/base
github:gh-pr/2756/base
github:gh-pr/2812/base
github:gh-pr/3032/base
github:gh-pr/2992/base
github:notes/card-time-and-plant-flicker
github:gh-pr/2986/base
github:gh-pr/3000/base
github:gh-pr/2966/base
github:gh-pr/2924/base
github:gh-pr/726/base
github:gh-pr/2761/base
github:gh-pr/2663/base
github:gh-pr/2861/base
github:gh-pr/2862/base
github:gh-pr/2820/base
github:gh-pr/2811/base
github:gh-pr/2803/base
github:rt-call-trace
github:gh-pr/2802/base
github:gh-pr/2766/base
github:perf/ahead-split
github:gh-pr/2589/base
github:gh-pr/2699/base
github:gh-pr/2696/base
github:docs/readme-runtime-proposal
github:gh-pr/1346/base
github:codex/coord-claim-check-20261124-7e48
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
area: ci
.github/ workflows and settings
area: d3d12
The D3D12 runtime in d3d12/ (Rust: leonida.exe and its crates)
area: docs
Documentation
area: launcher
The launcher (launcher/)
area: runtime (legacy)
The earlier Vulkan runtime in runtime/
area: shader translator
The shader translator (leonida-shader, tools/rdna2spirv) and its tests
area: tools
tools/ and scripts/
area: viewer
The map viewer (viewer/)
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs in-game run
Changes the code a frame runs through: needs the 300 s in-game gate (docs/game_gate.md)
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
wontfix
This will not be worked on
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!2892
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2892"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@djrolfes on GitHub · 2026-12-01 15:37 UTC · original
djrolfes:djrolfes/gpu-pipeline-empty-leaves-soundness→main· +50 −4 · 1 files · 1 commits · openClaimed in the coordination issue as:
D3D12-GPU-BOUND-STORES-EMPTY-LEAVES.What and why
Close a vacuous-truth soundness bug in
stores_in_bound_views(d3d12/crates/leonida-gpu/src/pipeline.rs): require at least one leaf descriptor source (!leaves.is_empty()) before declaring a buffer store or atomic bound.main,stores_in_bound_viewschecks: Because Rust'sIterator::allreturnstrueon an empty iterator, any descriptor whose tracked source has zero leaves — such asSource::LanePhi { args: [] },Source::LanePhi { args: [None, None] },Source::Phi { args: [] }, orSource::Select { args: [] }— vacuously evaluated totrueand was misclassified as provably bound forLEONIDA_INDIRECT_BATCH=4.bound_view_stores(program, &p, &res)fromstores_in_bound_viewsso tracked IR edge cases can be unit-tested directly.let leaves = d.source.leaves(); !leaves.is_empty() && leaves.into_iter().all(declared).d3d12/crates/leonida-gpu/src/pipeline.rsand keepsstores_bound() -> boolsignature unchanged — zero overlap withenlight3d's#2868(D3D12-BATCH-HEAP-READS, which touchesdraw.rs+indirect/batch.rs) or#2569.d3d12/crates/leonida-gpu/src/pipeline.rs) + red→green unit test + MEASURED 300 s in-world Option-A roam gate.Tested
python3 -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/pipeline.rs→ exit 0.leonida-gpuunit test binary (x86_64-pc-windows-msvc) and ran under Wine:origin/main(withbound_view_storesextracted preservingorigin/main's.all(declared)logic and the new testbound_view_stores_rejects_empty_joins_and_missing_descriptors):2e7c3467d(rebased onto3e7b34a52): (Pluspipeline::tests::3 passed; 0 failed.)2e7c3467d, Series S + DLSS Quality1280×720 → 1920×1080,LEONIDA_INDIRECT_BATCH=4, Option Amods/gate_drivermode = roam):310.70 sin-world after world entry at66.99 s; also passed an earlier cold-cache 310.19 s run with0errors).1,708frames after +60 s (1,796total world presents),10.52median FPS (12.26end median FPS),394.52 msp95 frame time,4.022 slongest present gap (<= 10.0 s).6,759 MiBpeak VRAM (<= 7,400 MiB),0device losses (0x887A0005),0crashes,0panics,0faults before stop,0kernelNVRM: Xiderrors.GATE CONTROLreached att = 70.0 s(moved = 7.63 m,mode = roam),32GATE MARKroam ticks,0GATE FAIL.GPUs tested: NVIDIA GeForce RTX 3070 Ti 8 GB, driver 620.73.04, Arch Linux (Wine 11.22 + VKD3D-Proton 3.2.0).
AI-assisted: yes (authored by Gemini 4 Neon; reviewed in a separate independent review pass by Gemini 4 Neon).
Checklist
main(3e7b34a52) and merges cleanly (a conflicting pull request is labeledneeds rebase).check_no_game_data.pyclean on both source and PR description).docs/design.md, with how it was confirmed. (n/a — GPU bound-store proof soundness fix)@Kal0s-design on GitHub · 2026-12-01 17:22 UTC · original
Verified on native Windows 11 (MSVC target, rustc 1.98.1), since the runs in the description are under Wine.
Head
2e7c3467dmerged withmaind2a564b66(clean merge):cargo test -p leonida-gpu --lib pipeline::: 39 passed, 0 failed, 8 ignored. Bothbound_testspass.cargo clippy -p leonida-gpu --all-targets: nothing inpipeline.rs.The test catches the change. With
!leaves.is_empty() &&removed (themainlogic in the extracted function),bound_view_stores_rejects_empty_joins_and_missing_descriptorsfails atpipeline.rs:1382withunproven descriptor: LanePhi { block: 0, args: [] }. That matches the red in the description.Not checked: the full
leonida-gpusuite and the game.GPUs tested: n/a (CPU unit tests only).
AI-assisted: yes (Claude Code).
@KelboLive on GitHub · 2026-12-01 17:26 UTC · original · reviewed
The guard is sound and minimal:
leaves()is non-empty forLoaded/Built(resource.rs:101-110), so single-source descriptors still pass, while emptyPhi/Select/LanePhijoins now fail closed — and the loss is visible throughBOUND_SAID,undeclared_whyand batch closure rather than silently dropped. Extractingbound_view_stores(pipeline.rs:599-650) so the proof can be tested directly is the right move, and deleting!leaves.is_empty() &&fails the new test exactly atpipeline.rs:1382(unproven descriptor: LanePhi { block: 0, args: [] }). 632/0/59 on the crate, merge clean against current main.Two follow-ups worth doing in this PR or a note:
per_lanereally can emitLanePhiwith every argNone(resource.rs:1954-1976), so a captured real shader/pipeline would be stronger than only the synthetic overwrite — the test currently proves the predicate, not that the tracker produces such a join..all()overleaves()sits atemit/lower.rs:9185and:9771. If empty joins are reachable there, the class is only half closed; either audit those two sites or reject empty joins where they are built.One correction to the body: #2868 is not zero-overlap at file level — it also edits
pipeline.rs(+199), and the two conflict textually where both append tests tobound_tests(merge-tree against its head exits 1). Semantically orthogonal and trivial to resolve by keeping both, but "zero overlap" will mislead whoever merges second. Against current main alone, this is clean.@EdenBendheim on GitHub · 2026-12-02 00:07 UTC · original
Independent native Windows 11 + RTX 3090 verification (
VERIFY-2892-RTX3090, claimed in #2570): PASS (with one non-blocking soundness note below)2e7c3467dmerged cleanly ontomain913b88b90(diagnostics,mimalloc,exe_sha16:fea732e495041a36).610.88).python -I scripts/check_no_game_data.pypassed on all changed files.cargo test -p leonida-gpu --locked -- bound_view_stores_rejects_empty_joins_and_missing_descriptors --test-threads=1):913b88b90with PR test overlaid: compile red on base; testing the old predicate against the extracted helper failed on emptyLanePhi.--features diagnostics): 1 passed, 0 failed in both configurations.scripts/game-gate.ps1, Series X 1080–1440p,-NoFrameGen, upgraded 8-leg sprint/wide-turn/jumpgate_driver+LEONIDA_GAME_ACTIONS_RUN="150:weather RAIN"):PASS(reasons=[],warnings=[],exit=clean,stop=target,cache_saved=true,GATE CONTROLfired withmoved=1.80 m, maxfrom_control_m=9.8 m,weather RAINconfirmed PASS).world_s=305.9s,world+60s, 4,847 presents, 6,528.5 median draws):20.47 FPSmedian,15.22 FPSp5,65.69 msp95 frame time,2.396 slongest present gap,0missed pipeline waits,32,455 MBmax private memory,303 MBmin commit left,13,419 MBmax VRAM (0 sover budget).leaves()flattens the tree (worth checking whether the tracker can emit nested empty joins).AI-assisted: yes (Gemini 4 Neon orchestrator; Codex GPT-6.2 Astra build, unit tests, and serialized RTX 3090 gate execution).
@MoonEyes on GitHub · 2026-12-02 12:30 UTC · original
This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).
Could you, or anyone with a working setup, post a run report on the current head merged onto current
main:mainSHA it was merged onto;mainalone for comparison, if you can.Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.
AI-assisted (Claude Code).
@MoonEyes on GitHub · 2026-12-02 18:12 UTC · original
Reviewed #2892 (code review only, not built here: Windows-only). The fix is right and its test is meaningful. The red CI is not from this change, but it is from a 1 December run on a 493-commits-old base, so CI needs a fresh run. The requested in-game run is missing.
2e7c3467d8(unchanged since 1 December)main45dc41f95cgit merge-tree); merge base3e7b34a52a, 493 commits behindlinux-python-and-viewerred ontests/test_x64_recomp_qemu_runner.py,test_x64_recomp.py,test_wave_trace.py,test_wave_diff.py(files this PR does not touch);checkred as their aggregate;d3d12 (windows-latest)greenVERIFY-2892-RTX3090, PASS)Review of
d3d12/crates/leonida-gpu/src/pipeline.rsfound.all(|d| d.source.leaves().into_iter().all(declared))is vacuously true when a descriptor's source has no leaves (aLanePhi/Phi/Selectwith no live arguments), so a store through a descriptor nobody proved bound passedstores_in_bound_views. The fix (!leaves.is_empty() && ...) makes an empty join unproven. That is the conservative answer, and it is the root cause, not a special case.bound_view_storesout ofstores_in_bound_viewslets the test feed hand-madeResources(emptyLanePhi, all-NoneLanePhi, emptyPhi/Select, aPhijoining a bound source with a constant, aSamplerrole, no descriptors) without depending on the tracker producing those shapes. Each one asserts the conservative answer, and the positive case (one live edge with a declared source) still passes. Without the fix, at least the empty-join cases would returntrue, so the test fails onmain's code.Verdict: ready after a CI rerun on a current merge (merge
maininto the branch) and the in-game run MoonEyes asked for on 2 December 12:30.AI-assisted: Claude Opus 5.5 (Claude Code), review only.
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
@MoonEyes on GitHub · 2026-12-02 21:40 UTC · original
RUN (independent run on Windows, head
2e7c3467d8b001b47c1bef2d80366abc97d2f8be, merged intomainb41763227aeed2d23c98af84bcbc1bddc7acdc90withgit merge --no-ff)Merge: clean, no conflict. Diff against
mainisd3d12/crates/leonida-gpu/src/pipeline.rsonly (+50/-4). Windows 11, MSVC, release profile,--locked.Green
cargo test -p leonida-gpu --release --locked --lib: 704 passed, 0 failed, 59 ignored. Bothbound_testspass, includingbound_view_stores_rejects_empty_joins_and_missing_descriptors.--features diagnostics --libnot run: the PR touches no diagnostics code. No Python test is touched.Red
The new test calls
bound_view_stores, which does not exist onmain, so restoringmain'spipeline.rsremoves the test and the helper together: that is a compile-level red only. I used mutations of the new code instead, each run withcargo test ... --lib bound_:!leaves.is_empty() &&(themainlogic)LanePhicaseleaves.len() > 1 &&bound_testsfailall(declared)changed toany(declared)Phiof a declared source and a constant case failstrueNo mutation survived. The worktree was restored after each one.
Review
LEONIDA_INDIRECT_BATCHis not 4; the proof only gets stricter (fails closed).docs/switches.mdneeds no regeneration.uselines into the extracted function.D3D12-GPU-BOUND-STORES-EMPTY-LEAVESin #2570 (the claim and done posts are in that thread).pipeline.rs) is now closed. No other open overlap checked beyond that.LEONIDA_INDIRECT_BATCH=4, PASS, 0 device losses), merged ontomain3e7b34a52(554 commits behindmainb41763227), and EdenBendheim's native Windows RTX 3090 300 s gate (PASS, clean exit), merged ontomain913b88b90. Kal0s-design verified the unit tests natively.Resources, not that the tracker emits an all-NoneLanePhiin a real program; (2) the same.all()overleaves()pattern exists inleonida-shader/src/emit/lower.rs(two sites, now around lines 9326 and 9912); (3) a nested empty join next to a declared source.resource.rs,Source::leaves):leaves()flattens, so aPhiof an emptyLanePhiand a declaredLoadedsource yields one leaf and passes. This matches the semantics the PR's own test asserts on purpose (LanePhi { args: [None, Some(bound)] }passes: a live edge with a declared source is sufficient); the nested case is the same meaning one level deeper. I did not run it, so it is read, not measured.Not covered
main; the two posted runs above used older mains (3e7b34a52, 554 commits behindb41763227, and913b88b90), so that request is not met. A main-only comparison was asked for only "if you can"; it is absent too.Verdict
PARTIAL. Not PASS, because two conditions are open: (a) no in-game run of this head merged onto current
main(the maintainer's firm request; posted runs are on older mains), and (b) CI not re-checked on a fresh base. The fix itself is correct for the case it claims, its test is non-vacuous (4 of 4 mutations killed), and lib tests are green on merge (704 passed). Thelower.rssites and reviewer point (1) are follow-ups, not blockers. Once a run on currentmainand a green CI are posted, this can move to PASS.AI-assisted (Claude Code), models: Claude Opus 5.5 (checker), separate Claude Opus 5.5 judge.
@OreoFR on GitHub · 2026-12-02 22:53 UTC · original
In-game run (batch with #2891, #2911, #2952, #2965 on main
f3865cae87, merged --no-ff): PASS2e7c3467d8AI-assisted (oreofr-agent)
@fiestorra on GitHub · 2026-12-03 03:25 UTC · original
VERIFY-2892 — el test nuevo pasa, y el cambio se separa en dos para poder probarlo
Un fichero,
pipeline.rs, +50/−4, cuatro días abierto:Y lo que el cambio hace consigo mismo es la parte que quiero acreditar: saca
bound_view_storesa una función propia, con este comentario:Eso es refactorizar para que el caso raro sea alcanzable desde un test — la alternativa habría sido un test que monta medio tracker para llegar a un estado que el tracker, en la práctica, casi nunca produce. Separar la función es más código y mucho menos test.
Y el caso que cubre es de los que fallan en silencio: un join de descriptores vacío en
bound_view_stores— si no se rechaza, la textura se ve negra y nada en el log dice por qué.Lo que no probé: un shader real con un join vacío — el test construye el IR a mano, que es exactamente lo que el comentario dice que buscaba.
Y una nota sobre la suite: como en
#2841, el total deleonida-gputiene 1 falla y es la de la iGPU de esta máquina, no de esta PR — corrido su test solo, pasa.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.