Ray-tracing builder translates on 32-lane GPUs; textures spill to shared memory; findings on a 6 GB laptop #601

Closed
DiogoPCastelos wants to merge 3 commits from upstream-pr/601 into main
DiogoPCastelos commented 2026-11-25 02:54:53 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by DiogoPCastelos on 2026-11-25T02:54:53Z.


Bring-up on a machine well below the fork's test machine (RTX 3060 Laptop 6 GB, i7-11800H, 16 GB RAM), rebased on main at 9376fd6. Where upstream has since done the same thing, upstream's version is kept and this branch's was dropped: v_cvt_f32_f64, v_permlane16/x16, first-half interpolation pairs, descriptors read only for their sizes (unused_descriptor_kind), the texture catch-up budget, the R9G9B9E5 stand-in, translate --warm. Every program those fixed still translates and validates.

What changes

Ray-tracing builder (off by default, VICTORY_BVH_BUILDER=1)

  • All 52 programs of the builder DLL now translate, validate and make pipelines on a 32-lane GPU (49 before). The last three are block-wide scans that broadcast a sum with v_readfirstlane inside a loop each console wave leaves together. lane_uniform now proves a shared-memory read at a uniform address uniform where the memory has settled (lds_settled: no write after it, every write before it behind an s_barrier), so both halves of a console wave take their own first lane. This is the case VICTORY_FIRSTLANE_OWN=1 was added for, now proven per program.
  • lane_uniform no longer counts a destination's old value as one of an operand's registers (an instruction whose destination was not one of its sources was never uniform).
  • In a run the builder now runs ("all of its programs have host pipelines pipelines=53") but is not usable yet: a stage stores outside the structures' buffers. The title faults within seconds, and with VICTORY_BVH_QUARANTINE=1 the layer runs out of memory copying what those stores name. The three scans are not the cause: a GPU test runs their form and checks every thread. Details and next steps in docs/fork-findings-6gb-laptop.md.

Shaders

  • Programs whose only cross-lane code is v_permlane16/x16 keep the console's lane order (upstream lowers the instructions but did not ask for that order).

Runtime

  • Textures picked by index may spill into the memory the system shares with the card once the card's share is reached, up to half of that budget (VICTORY_TEXTURE_SPILL=0 turns it off). On 6 GB, skin, walls and clothes sampled black without it. Upstream's kept room (buffer copies, first-frame targets) counts as used in both rules.
  • A dispatch whose pipeline is still being made waits for it instead of being dropped (VICTORY_COMPUTE_WAIT=0 drops it as before).
  • Pipeline workers wait while less than 2 GB of the system's commit is left (VICTORY_PIPELINE_COMMIT_MB).
  • Device slots 0x1c8/0x218 are Deserialize{Graphics,Compute}PipelineStateX. The title falls back to its description, so they now fail with one info line instead of a warning per call.
  • Series S: present planes are read at their real 72-byte size and their layout is logged from the title's descriptions. The UI plane is not composed yet.

The XCL items (the slot names, compute waiting, the commit guard) are ideas from its notes, written anew; no code was taken (XCL is GPL-2.0-only).

Testing

  • cargo test --workspace --release on the rebased branch: all pass (shader crate 218, GPU crate 144, HLE 98).
  • New GPU test a_scan_over_console_waves_sums_each_waves_predecessors passes on the RTX 3060. New unit tests for lds_settled (positive, no-barrier and write-after cases).
  • As for this GPU (VICTORY_HOST_WAVE=32 … --validate --pipelines): all 52 builder programs. The programs fixed while this was written (deferred materials, puddles, a shallow-water reduction, water transmittance) validate and make pipelines with upstream's fixes. Two water volumetrics programs validate but the driver refuses their pipelines (upstream's state; listed in the doc).
  • cargo xtask policy: ok. Formatting: no rustfmt differences added beyond each file's existing ones.
  • The documented warm-up (--warm all with this GPU's two settings) followed by a launch: 2,119 shaders from the cache, 2 translated.

Not done

  • GPU feedback for textures picked by index, so the slots the frame samples come first.
  • The builder stage that stores out of bounds.
  • The five compute programs that still need 64-lane waves (shared memory inside per-lane branches).
  • Composing the Series S UI plane.

🤖 Generated with Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:issue:5484275360 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/601). Originally posted by [DiogoPCastelos](https://github.com/DiogoPCastelos) on 2026-11-25T02:54:53Z. --- Bring-up on a machine well below the fork's test machine (RTX 3060 Laptop 6 GB, i7-11800H, 16 GB RAM), rebased on `main` at 9376fd6. Where upstream has since done the same thing, upstream's version is kept and this branch's was dropped: `v_cvt_f32_f64`, `v_permlane16/x16`, first-half interpolation pairs, descriptors read only for their sizes (`unused_descriptor_kind`), the texture catch-up budget, the R9G9B9E5 stand-in, `translate --warm`. Every program those fixed still translates and validates. ## What changes **Ray-tracing builder (off by default, `VICTORY_BVH_BUILDER=1`)** - All 52 programs of the builder DLL now translate, validate and make pipelines on a 32-lane GPU (49 before). The last three are block-wide scans that broadcast a sum with `v_readfirstlane` inside a loop each console wave leaves together. `lane_uniform` now proves a shared-memory read at a uniform address uniform where the memory has settled (`lds_settled`: no write after it, every write before it behind an `s_barrier`), so both halves of a console wave take their own first lane. This is the case `VICTORY_FIRSTLANE_OWN=1` was added for, now proven per program. - `lane_uniform` no longer counts a destination's old value as one of an operand's registers (an instruction whose destination was not one of its sources was never uniform). - In a run the builder now runs ("all of its programs have host pipelines pipelines=53") but **is not usable yet**: a stage stores outside the structures' buffers. The title faults within seconds, and with `VICTORY_BVH_QUARANTINE=1` the layer runs out of memory copying what those stores name. The three scans are not the cause: a GPU test runs their form and checks every thread. Details and next steps in `docs/fork-findings-6gb-laptop.md`. **Shaders** - Programs whose only cross-lane code is `v_permlane16/x16` keep the console's lane order (upstream lowers the instructions but did not ask for that order). **Runtime** - Textures picked by index may spill into the memory the system shares with the card once the card's share is reached, up to half of that budget (`VICTORY_TEXTURE_SPILL=0` turns it off). On 6 GB, skin, walls and clothes sampled black without it. Upstream's kept room (buffer copies, first-frame targets) counts as used in both rules. - A dispatch whose pipeline is still being made waits for it instead of being dropped (`VICTORY_COMPUTE_WAIT=0` drops it as before). - Pipeline workers wait while less than 2 GB of the system's commit is left (`VICTORY_PIPELINE_COMMIT_MB`). - Device slots 0x1c8/0x218 are `Deserialize{Graphics,Compute}PipelineStateX`. The title falls back to its description, so they now fail with one info line instead of a warning per call. - Series S: present planes are read at their real 72-byte size and their layout is logged from the title's descriptions. The UI plane is not composed yet. The XCL items (the slot names, compute waiting, the commit guard) are ideas from its notes, written anew; no code was taken (XCL is GPL-2.0-only). ## Testing - `cargo test --workspace --release` on the rebased branch: all pass (shader crate 218, GPU crate 144, HLE 98). - New GPU test `a_scan_over_console_waves_sums_each_waves_predecessors` passes on the RTX 3060. New unit tests for `lds_settled` (positive, no-barrier and write-after cases). - As for this GPU (`VICTORY_HOST_WAVE=32 … --validate --pipelines`): all 52 builder programs. The programs fixed while this was written (deferred materials, puddles, a shallow-water reduction, water transmittance) validate and make pipelines with upstream's fixes. Two water volumetrics programs validate but the driver refuses their pipelines (upstream's state; listed in the doc). - `cargo xtask policy`: ok. Formatting: no rustfmt differences added beyond each file's existing ones. - The documented warm-up (`--warm all` with this GPU's two settings) followed by a launch: 2,119 shaders from the cache, 2 translated. ## Not done - GPU feedback for textures picked by index, so the slots the frame samples come first. - The builder stage that stores out of bounds. - The five compute programs that still need 64-lane waves (shared memory inside per-lane branches). - Composing the Series S UI plane. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Headache3318 commented 2026-11-25 09:08:49 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Headache3318 on 2026-11-25T08:32:42Z.


Independent verification: PR #543 does not exist on this repo; verified PR #601 (Ray-tracing builder translates on 32-lane GPUs) instead. Build: success (7.93s). Tests: fail due to pre-existing Linux build errors in victory-loader (missing windows_sys) and victory-gpu (host_resource not in scope) — confirmed identical on main without this PR. PR #601 introduces no regressions. Conflicts: none. Machine: Arch Linux, kernel 7.3.5-arch1-1, 3x RTX 4090 driver 620.73.04, Proton, AI-assisted.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7157161813 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/601#issuecomment-7157161813). Originally posted by [Headache3318](https://github.com/Headache3318) on 2026-11-25T08:32:42Z. --- Independent verification: PR #543 does not exist on this repo; verified PR #601 (Ray-tracing builder translates on 32-lane GPUs) instead. Build: success (7.93s). Tests: fail due to pre-existing Linux build errors in victory-loader (missing windows_sys) and victory-gpu (host_resource not in scope) — confirmed identical on main without this PR. PR #601 introduces no regressions. Conflicts: none. Machine: Arch Linux, kernel 7.3.5-arch1-1, 3x RTX 4090 driver 620.73.04, Proton, AI-assisted.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
fxceless/victory-fork!601
No description provided.