Claude's work on the fork: upstream lints, wave-wide groups, descriptor sync, live switches, #6 diagnostics #11

Closed
github-bot wants to merge 26 commits from gh-pr/11/head into gh-pr/11/base
Owner

@⁠TaynanGT on GitHub · 2026-11-25 19:21 UTC · original
TaynanGT:claude/vice-tay → local/fxceless-render · +1514 −214 · 31 files · 26 commits · closed without merging

One branch for Claude's work on the fork. It replaces #5, #7, #9 and #10, and includes #6 (the diagnostics #9 fixes). Each part has its own commits and, where it adds or changes behaviour, a note under docs/, listed in the README's new "Performance notes".

1. Upstream's Clippy lints

Upstream (Marvisak/VIctory) keeps clippy::all and undocumented_unsafe_blocks at warn and its CI denies warnings; this fork let nine lints through, one of the reasons the maintainer gave for not taking the fork-wide Marvisak/VIctory#2257. The lint table is upstream's again and the code passes it, with no change in what it does:

  • 35 unsafe blocks get their own // SAFETY: comment (most repeat a group comment Clippy did not count).
  • 20 complex types get names (ByteRanges, SharedRanges, Totals, HandleKey, LdsMeet, Layouts, local aliases in tests).
  • Equivalent rewrites: saturating_sub, as_chunks, iterator loops and fill, byte slicing of a string, a match arm that reads the same with and without diagnostics, a test value that was always 1.
  • CI also runs on pushes to main, as upstream's does.
  • Eleven comments that named the title's shader programs describe them in our own words (with their hash where they had one): upstream's asset policy keeps all of the game's text out of the repository.

2. Wave-wide form for groups of several console waves

Console compute programs built for 64-lane waves are refused by the NVIDIA driver when their cross-lane code spans the console wave. The wave-wide form ran them as two 32-lane host waves only in groups of one console wave. In larger groups the two host waves of each console wave now meet only each other, through an LDS counter (a spin with a limit), instead of at group barriers. Offline, 8 of the 9 such programs of the first room translate, validate and create pipelines (new: 02384a60, 6b82bc7d, f133e35e, the cascade shadows of alpha-tested casters). Live: refused pipelines 3 → 1, about 8% slower because three more programs run, no device loss. Gated by VICTORY_WAVE_WIDE_ONLY. Details: docs/wave64-on-wave32.md.

3. Raw descriptor sync: a page's records under one lock

The sync mirrors 35,000 to 41,000 changed records a frame in the first room, 30 to 50 ms on the submitting thread. It now compares a written page's records under one lock instead of locking two tables per record: 38 → 29 ms a frame on 2146f54 (6.5 → 7.1 FPS), 5 to 9 ms cheaper in every pair on 77e1ac7. The whole sync costs 27 ms a frame (6.7 against 8.2 FPS with it off, measured in one session); it has not been shown to fix the missing walls it was written for, so its default is left open. Details: docs/descriptor-sync.md.

4. Live switches

VICTORY_LIVE=<file> turns VICTORY_HEAP_SYNC and VICTORY_WIDE_REFRESH on and off while the game runs, and VICTORY_METER_MS=1000 logs a frame line every second, so two settings are compared in one session and the same stretch of the scene (about five minutes, against about eight for two separate runs). Without VICTORY_LIVE nothing changes. VICTORY_WIDE_REFRESH=1 measured slower (6.1 against 7.0 FPS) and stays off. Details: docs/live-switches.md.

5. #6 and the fixes for its review

The diagnostics of #6 (drops and null views by reason, the unknown pipeline methods' dump, wave64 refusals), with the 15 review findings fixed: the dump reads guessed pointers only from committed memory with no guard page (a read of a guard page through the in-process copy disarmed the title's guard; test a_guessed_read_leaves_a_guard_page_armed), standard pipelines are counted only when made, drops and null views are counted under the right reasons, and the dump costs nothing after its first 256 calls per slot.

Tests

  • cargo clippy --workspace --all-targets --locked -- -D warnings and with --all-features: clean.
  • cargo test --workspace --release --locked: all passed (victory-gpu 256, victory-shader 297, the other crates, the asset policy: 195 files ok).
  • New tests: two_console_waves_take_a_wave_wide_branch_apart (ran on the RTX 4090), a_guessed_read_leaves_a_guard_page_armed, live::tests.
  • Live: first room on the RTX 4090, measured with teste-ao-vivo's scripts outside the repository; numbers above.

🤖 Generated with Claude Code

**@⁠TaynanGT** on GitHub · 2026-11-25 19:21 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/11) `TaynanGT:claude/vice-tay` → `local/fxceless-render` · +1514 −214 · 31 files · 26 commits · closed without merging One branch for Claude's work on the fork. It replaces #5, #7, #9 and #10, and includes #6 (the diagnostics #9 fixes). Each part has its own commits and, where it adds or changes behaviour, a note under `docs/`, listed in the README's new "Performance notes". ## 1. Upstream's Clippy lints Upstream (Marvisak/VIctory) keeps `clippy::all` and `undocumented_unsafe_blocks` at warn and its CI denies warnings; this fork let nine lints through, one of the reasons the maintainer gave for not taking the fork-wide Marvisak/VIctory#2257. The lint table is upstream's again and the code passes it, with no change in what it does: - 35 unsafe blocks get their own `// SAFETY:` comment (most repeat a group comment Clippy did not count). - 20 complex types get names (`ByteRanges`, `SharedRanges`, `Totals`, `HandleKey`, `LdsMeet`, `Layouts`, local aliases in tests). - Equivalent rewrites: `saturating_sub`, `as_chunks`, iterator loops and `fill`, byte slicing of a string, a match arm that reads the same with and without `diagnostics`, a test value that was always 1. - CI also runs on pushes to `main`, as upstream's does. - Eleven comments that named the title's shader programs describe them in our own words (with their hash where they had one): upstream's asset policy keeps all of the game's text out of the repository. ## 2. Wave-wide form for groups of several console waves Console compute programs built for 64-lane waves are refused by the NVIDIA driver when their cross-lane code spans the console wave. The wave-wide form ran them as two 32-lane host waves only in groups of one console wave. In larger groups the two host waves of each console wave now meet only each other, through an LDS counter (a spin with a limit), instead of at group barriers. Offline, 8 of the 9 such programs of the first room translate, validate and create pipelines (new: `02384a60`, `6b82bc7d`, `f133e35e`, the cascade shadows of alpha-tested casters). Live: refused pipelines 3 → 1, about 8% slower because three more programs run, no device loss. Gated by `VICTORY_WAVE_WIDE_ONLY`. Details: [`docs/wave64-on-wave32.md`](../blob/1c41ea2/docs/wave64-on-wave32.md). ## 3. Raw descriptor sync: a page's records under one lock The sync mirrors 35,000 to 41,000 changed records a frame in the first room, 30 to 50 ms on the submitting thread. It now compares a written page's records under one lock instead of locking two tables per record: 38 → 29 ms a frame on `2146f54` (6.5 → 7.1 FPS), 5 to 9 ms cheaper in every pair on `77e1ac7`. The whole sync costs 27 ms a frame (6.7 against 8.2 FPS with it off, measured in one session); it has not been shown to fix the missing walls it was written for, so its default is left open. Details: [`docs/descriptor-sync.md`](../blob/1c41ea2/docs/descriptor-sync.md). ## 4. Live switches `VICTORY_LIVE=<file>` turns `VICTORY_HEAP_SYNC` and `VICTORY_WIDE_REFRESH` on and off while the game runs, and `VICTORY_METER_MS=1000` logs a frame line every second, so two settings are compared in one session and the same stretch of the scene (about five minutes, against about eight for two separate runs). Without `VICTORY_LIVE` nothing changes. `VICTORY_WIDE_REFRESH=1` measured slower (6.1 against 7.0 FPS) and stays off. Details: [`docs/live-switches.md`](../blob/1c41ea2/docs/live-switches.md). ## 5. #6 and the fixes for its review The diagnostics of #6 (drops and null views by reason, the unknown pipeline methods' dump, wave64 refusals), with the 15 review findings fixed: the dump reads guessed pointers only from committed memory with no guard page (a read of a guard page through the in-process copy disarmed the title's guard; test `a_guessed_read_leaves_a_guard_page_armed`), standard pipelines are counted only when made, drops and null views are counted under the right reasons, and the dump costs nothing after its first 256 calls per slot. ## Tests - `cargo clippy --workspace --all-targets --locked -- -D warnings` and with `--all-features`: clean. - `cargo test --workspace --release --locked`: all passed (victory-gpu 256, victory-shader 297, the other crates, the asset policy: 195 files ok). - New tests: `two_console_waves_take_a_wave_wide_branch_apart` (ran on the RTX 4090), `a_guessed_read_leaves_a_guard_page_armed`, `live::tests`. - Live: first room on the RTX 4090, measured with `teste-ao-vivo`'s scripts outside the repository; numbers above. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A wave64 program on a 32-lane host runs each console wave as two host
waves. In a group of several console waves, each console wave takes a
wave-wide branch on its own, so a group barrier inside the branch waits
for waves that never arrive. The two host waves of a console wave now
meet through an LDS counter of their own instead: the first to arrive
spins until the other does, with a spin limit so a missing partner
gives wrong values rather than a hung GPU.

Programs named in VICTORY_WAVE_WIDE_ONLY whose LDS already fills
32 KiB place these dwords over their last ones (6b82bc7d uses its LDS
as a bitset that is read from the start).

Offline on an RTX 4090, 8 of the 9 WaveSize 64 compute programs the
driver refused or translated approximately now translate, validate and
create pipelines; 02384a60, 6b82bc7d and f133e35e are new. 2da4beb3
still fails: it builds a sampler inside a region it can skip.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The SCC of a lane-mask operation joined at a skip was refused with the
  same words as a mask read as a number, which the local forms take: the
  two need different fixes, and a log could not tell which stopped a
  shader (f133e35efed2a48a). It now says "an SCC of a lane mask
  exchanged where not every lane runs" (the suffix keeps the retries).
- With VICTORY_WAVE_WHY, the translator's WAVE64 lines carry no hash and
  came from translations on several threads; translations then run one
  at a time, each between two lines naming its shader.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WFqqAvbrdcaXe2SvGb2y64
The frame line's "dropped N without a host pipeline" (~344 a frame in a
release run) counted every draw and dispatch dropped, whatever the
reason: pipelines with no host pipeline, stages of the ray-tracing
structure builder while it is off, binds refused, index buffers without
a host copy, rectangles not expanded, mesh dispatches switched off. A
line per period now gives them per frame by reason, so the next run
shows which one to fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WFqqAvbrdcaXe2SvGb2y64
The frame line's "buffer views left null as the host would refuse them"
grew by about four a frame in a release run, and only the first of each
call site was logged. An empty view loses nothing; a raw view that
starts off 16 bytes (one logged: 184 dwords from dword 2) or a view not
on an element of its copy hides data the title wrote, and views of
memory with no host copy were not counted at all. Each null view is now
counted by reason, the first of each reason logged with its fields, and
the frame line gives the split next to the old total.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WFqqAvbrdcaXe2SvGb2y64
The title calls device methods 0x1c8 and 0x218 thousands of times (over
16,384 and 2,048 in a release run) and goes without the pipelines they
fail to make, which may be details missing from the image. Only the
first 16 words of a few descriptions were logged, not what they point
at, and whether the title then makes the same pipelines through the
standard methods was not known.

- The doc of unknown_pipeline says what the logged descriptions held.
- The first calls of each slot and the first two of each layout log
  every blob a description points at (bytes and a hash), up to 48 calls a
  slot, and every 1024th call logs the count.
- Pipelines made through the standard methods (0x50, 0x58, 0x1f0, 0x2b0)
  are counted, and apart when the same thread's last unknown call came
  just before (under 20 us, 200 us, 2 ms, later): a fallback shows about
  one per failed call.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WFqqAvbrdcaXe2SvGb2y64
The raw descriptor sync reads each changed 64 KiB heap page and called
mirror_copied for each of its 2,048 records, locking the made and copied
tables per record, though most records of a written page are unchanged.
It now compares the page's records with the kept ones under one lock and
mirrors only those that changed.

In the first room the sync took 38 ms a frame on the submitting thread;
with this change 29 ms, and the frame rate went from 6.5 to 7.1 FPS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The unknown pipeline dump reads only committed, readable memory with no
  guard page: its pointers are guessed, and the in-process copy took a
  guard page's one-shot exception, disarming the title's guard. Test:
  a_guessed_read_leaves_a_guard_page_armed.
- The dump looks at the first 256 calls of each slot, falls back to the
  slot's shortest description (12 words for 0x218), keys graphics layouts
  on the first two groups only, logs words up to the last present group
  and leaves groups out of compute lines.
- Standard pipeline methods are counted once they made a pipeline, timed
  from when the title called; the first ones, and the first that follow an
  unknown call, are logged.
- A dispatch with a graphics pipeline is counted as a pipeline of another
  kind; a host list without mesh dispatches has its own reason; indexed
  rectangles without a host pipeline count as no host pipeline. The drop
  line gives the counts beside the rates, and the frame line no longer
  calls every drop a missing pipeline.
- Buffer views: empty views are counted first, views of a format with no
  element size count as typed, and each reason is logged once for shader
  resource views and once for unordered ones.
- Docs: VICTORY_WAVE_WHY slows pipeline making; the unknown pipeline notes
  say what this build logs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs/wave64-on-wave32.md: why the driver refuses WaveSize 64, how the
translator places a console wave on two host waves, the wave-wide form,
pair meetings for groups of several console waves and the LDS budget,
the switches, the first room's programs with their state, offline and
live results, known gaps and the test. The README's shader row links it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs/descriptor-sync.md: what the sync does and why, its cost per frame
in the first room, the change in this branch with measurements on two
bases, VICTORY_HEAP_SYNC and its effect, the frame log line and the
tests that cover it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comparing two settings by starting the game twice costs about three
minutes per run to load the same scene, and lands on a different moment
of it. Live switches change while the title runs.

- live.rs: a Live switch reads its environment variable once; with
  VICTORY_LIVE=<file> a thread reads NAME=VALUE lines from that file four
  times a second and overrides it. A check is one atomic load; each
  change is logged as "live switch NAME=VALUE".
- VICTORY_HEAP_SYNC and VICTORY_WIDE_REFRESH are live.
- VICTORY_METER_MS sets how often the frame line is logged (5 s by
  default); 1000 logs every second's numbers.
- docs/live-switches.md: use, method, which switches are live, results.

In one session on the first room, VICTORY_HEAP_SYNC on against off over
three 20-second cycles: 6.7 FPS (148.5 ms) against 8.2 FPS (121.8 ms),
49 one-second samples per state.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Upstream keeps clippy::all and undocumented_unsafe_blocks at warn and its
CI denies warnings; this fork let nine lints through. The workspace lint
table is upstream's again, and the code passes it without changing what
it does:

- 34 unsafe blocks get their own SAFETY comment (most repeat a group
  comment Clippy did not count; seven are new, written from the code).
- 19 complex types get names (ByteRanges, SharedRanges, Totals,
  HandleKey, LdsMeet, local aliases in tests).
- Equivalent rewrites: saturating_sub, as_chunks, iterator loops and
  fill, byte slicing of a string, a match arm that reads the same with
  and without diagnostics, a test value that was always 1.

CI also runs on pushes to main, as upstream's does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two places the PR #6 diagnostics added that upstream's lints flag: the
LAYOUTS static's type gets a name, and a test's zeroed
MEMORY_BASIC_INFORMATION gets its SAFETY comment.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Links the notes on live switches, the raw descriptor sync and 64-lane
programs on 32-lane GPUs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comments named eleven of the title's shader programs. Upstream's asset
policy keeps every piece of the game out of the repository, its text
included; the comments now say what each program does, with its hash
where they had one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:57:58 +00:00
github-bot closed this pull request 2026-11-26 05:57:58 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-25 19:32 UTC · original · edited 2026-11-25 20:01 UTC

Everything here is in main as of 1c41ea2 (commits reapplied on top of the upstream snapshot). The fork now keeps a single branch, main.

**@⁠TaynanGT** on GitHub · 2026-11-25 19:32 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/11#issuecomment-7172429868) · edited 2026-11-25 20:01 UTC Everything here is in `main` as of 1c41ea2 (commits reapplied on top of the upstream snapshot). The fork now keeps a single branch, `main`.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.