Shaders: view-address table for descriptors picked by a computed index #749
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/749"
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?
Imported from fxceless/victory-fork. Originally posted by Revens2 on 2026-11-25T06:14:56Z.
Refs #279 (the pixel programs whose descriptor is "read only as data").
What is in it
SLOT_VIEWS, a root SRV likeSLOT_STRIDES, 2^21 slots x 16 bytes, so +32 MiB of upload buffer per view heap). It is written where a slot is written; the lowering reads the address, length and stride from it. A computed term in a used descriptor's address takes the same table.translate --validateon the same title pack with both trees: VItoriaBr had no "read only as data" failures, main had 40. Thelower.rs,descriptor/host.rs,pipeline/host.rs,emit/mod.rsandemit/shader.rsparts apply unchanged; thedraw.rspart is rewritten for the current main (it conflicted).Tested
victory translate <pack> --validate,VICTORY_HOST_WAVE=32, main8dd30abagainst this branch:cargo build --workspace --lockedandcargo test --workspace --locked -- --test-threads=4on this branch: 526 passed, 0 failed, 10 ignored.Not tested
AI use
Regression run
🤖 Generated with Claude Code
Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T06:21:25Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
9b6b344b07ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T06:15:06Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
41a3892ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from fxceless/victory-fork. Originally posted by ArturoWolff on 2026-11-25T06:40:02Z.
Linux offline comparison for the 64-lane question, with a 32-lane control. I built the translator separately at main
8dd30ab, #738ea40c9a, and this PR9b6b344. Same hash-checked inputs, directemit::translate, no shared shader cache;set_host_max_wave(32)and then(64). These are compiler settings, not a test on AMD hardware.PuddleDetectpixel shaders named in #279 (2fd01fca16993001,6b6db9f1a526daeb,7d0f14ce44746d7e) were refused on main and #738 at both settings. On #749 all three translated and passeddxvat both settings. This overlaps the earlier #203 replay; it is not three additional shaders on top of #203. Unlike #203 at 32, #749 still refused the shallow-water timestepceb5eb68cd99cb07at0x38.The useful next check for the new pixel shaders is a readback with distinguishable buffer addresses at nonzero descriptor indices and a nonzero table offset.
dxvacceptance cannot resolve the stride/offset review findings. No retail launch, GPU execution, or change in visible pixels measured here.AI-assisted: Hermes Agent ran the local comparisons and validator, checked the byte equality, and wrote this comment on ArturoWolff’s behalf.
Imported from fxceless/victory-fork. Originally posted by Revens2 on 2026-11-25T06:40:25Z.
In-game check (RTX 5070 12 GB, driver 32.0.16.2124, Series X profile,
VICTORY_RELAY=2, same key script, 420 s, release build; another agent's game was running alongside in the first run):8dd30abThe 7 refused compute pipelines ("Paramètre incorrect") appear on main too. One crash in three on the branch against one run on main is too few to say whether the PR changes crash odds (0xC0000005 during loading is already reported in #416/#453); the fps difference is within run-to-run spread. Not checked: any picture difference for the 35 programs that now translate.
Imported from fxceless/victory-fork. Originally posted by Revens2 on 2026-11-25T06:53:22Z.
Thanks for the review. Both findings are fixed in
41a3892, and the branch is rebased on maina26859f.SLOT_VIEWStable by a shift of 4. The shift comes from a shared constant,SLOT_VIEWS_RECORD_BYTES = 16, which the host allocation also uses. TheSLOT_VIEWSdoc comment said "two dwords per slot" and is corrected.view_address_indexedno longer adds the table byte offset to the loaded address. That offset is already part of the slot index, so the address read from the table is returned unchanged.Tests:
cargo build --workspace --lockedis clean.cargo test --workspace --locked -- --test-threads=4gives 535 passed, 0 failed, 10 ignored. Two new unit tests, one per finding: the record stride is 16 and the shift matches it, andview_address_indexeddoes not offset the loaded address.The P2 test is a source check on the function body (no
address_pluscall). It is not a readback. As @ArturoWolff noted, a readback with nonzero descriptor indices and a nonzero table offset is the check that settles this. No in-game run yet, so that stays "not tested".Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T06:21:25Z.
Code review location:
crates/victory-shader/src/emit/lower.rs; line 2720For a computed descriptor index above 0, this uses an 8-byte stride even though the host allocates and writes four dwords (16 bytes) per slot. The four-component load therefore reads overlapping records instead of the selected slot, so shader code can use a bogus address when walking the buffer. Shift by 4, or otherwise match the host writer's 16-byte entry size.
Useful? React with 👍 / 👎.
Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T06:21:25Z.
Code review location:
crates/victory-shader/src/emit/lower.rs; line 2744When the
s_loadaddress has a nonzero root-relative descriptor-table offset,heap_indexhas already used that address to select the absolute heap slot read fromSLOT_VIEWS;a.offsetis part of the descriptor-table address, not an offset into the selected buffer. Adding it here shifts the returned title pointer (for example, an entry at byte offset 32 yields its buffer address plus 32), so address-based walkers can read unrelated bytes. Leave the fetched address unchanged.Useful? React with 👍 / 👎.
Imported from fxceless/victory-fork. Originally posted by ArturoWolff on 2026-11-25T07:32:45Z.
I checked the nonzero-index/nonzero-offset case against
41a3892and its direct parenta1855ac. The emitted shader selects the intended record and returns its address unchanged on41a3892. This is a CPU interpretation of the DXIL, not a device readback. Both versions passdxv, so validation alone would miss the difference.The same synthetic one-thread compute shader used a table base of 32 bytes, dynamic index 4, and immediate table offset 32 bytes (expected slot 6). Eight 16-byte host records had distinct addresses and stride tags. The shader returned the address and tag; it did not dereference the address.
a1855ac0x280→0x2a041a38920x400→0x400The tag identifies the record independently of the returned address: the parent both selected the wrong record and added 32 after loading it. Neither error occurred on your fix. Unlike my earlier puddle-shader translation comparison, this checks the values produced by the emitted operations. The isolated lavapipe attempt timed out during initialization, before dispatch; actual host binding, device output, and in-game pixels remain unverified.
AI disclosure: Hermes Agent built the synthetic fixture, validated the DXIL, reran the CPU/IR comparison, and wrote this follow-up on ArturoWolff’s behalf.
Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T09:42:31Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
41a3892c9eℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from fxceless/victory-fork. Originally posted by Revens2 on 2026-11-25T09:35:16Z.
@ArturoWolff thanks for checking the emitted DXIL on
41a3892and for pinning the bad parent (a1855ac). The in-game and device-readback side is still unverified on our end; we will report a run on this head when the queue reaches it.@codex review
Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T09:42:31Z.
Code review location:
crates/victory-gpu/src/draw.rs; line 1087If the 32 MiB
viewsupload allocation fails,HostHeap::newleavesviewsunset andheap_viewsreturnsNone. This arm only warns and continues, so the draw or dispatch still runs without a validSLOT_VIEWSroot SRV; the shader's raw loads then read zero or undefined addresses. Refuse the submission when this required table cannot be bound.Useful? React with 👍 / 👎.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.