Repository navigation
Conversation
…py, and only marked copies are taken for written Each list that could store through title memory by address declared every numbered copy written: a snapshot before the submission and a compare after it, of all 1,023 copies (4.3 GB) in the prologue with the structure builder on. A frame took 3.3 s on an RTX 5080, 2.8 s of it there. Stores and atomics now set a mark per copy after the fault notes. The host reads the marks once a frame, and a list declares written the copies marked in the last 8 frames, the copies its dispatches name, and the copies numbered while it is recorded. Same scene: 0.55 s a frame. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TydV9AGmPCiUTkG8rHubBQ
|
AI-assisted (Claude Code). A clarification of one line in the description, from a measurement made after opening this: with the builder off (defaults) the memory-by-address path numbers no copies at all on this card (0 numbered, 0 loads, 0 stores over a 300 s run). So "nothing moves in a normal run" holds because nothing uses the path then, which is a simpler reason than the frame times I gave. The change only matters once something numbers copies, today the structure builder. The counts behind this, and what they say about the 1,023-copy limit, are in #284. |
A hand-assembled compute program stores one dword per thread at an address it builds in a register pair, with a third of its threads masked out. On the hardware adapter and on WARP: each running thread's dword lands in the copy the directory names for the page, that copy's mark is set and no other, and the masked threads store and mark nothing. With no copy for the page, the stores are dropped at the base slot, the page is noted among the faults and no copy is marked. The test host gets a root UAV over one of the heap's writable buffers (`Root::Written`), for the fault notes and marks. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TydV9AGmPCiUTkG8rHubBQ
|
AI-assisted (Claude Code). Pushed Mutation check: with the mark removed from The test host gains
|
|
AI-assisted (Claude Code). Numbers and log lines only; no game data. Tested on an RTX 4080: with the builder on, 4.5 s a frame becomes 0.85–0.9 s (1.1–1.2 fps). Setup
What the marks do here. A per-frame tally added locally in
All 1,023 copies (21.5 GB) are still refreshed, by 5 lists a frame. What remains.
Pitfall for anyone testing this PR. If you copy a
A Follow-ups on top of this PR. All are opt-in, on VIcky's
If any of these would be useful here or in a separate PR, say so and I'll open it against |
…marked copies are taken for written; 8,191 copies Port of fxceless PR fxceless#346 (c3db707, Gargalindis) onto the fork's directory: stores and atomics through title memory by address set a per-copy mark after the fault notes (MEMORY_MARKS); the host reads the marks once a frame, and a list that can store declares written only the copies marked in the last 8 frames, the copies its dispatches name and the copies numbered while it is recorded. Before, every list declared every numbered copy written: with the structure builder on, 3.9 GB of snapshots and compares a frame (run 3 at 266cd04, 584 ms/frame). fxceless measured 3.3 s -> 0.55 s a frame. VICTORY_MEMORY_MARKS=0 takes every copy for written, as before. The copy table grows from 4,095 to 8,191 (as fxceless fxceless#980): run 3 filled 4,095 a minute in, after which pages without a number read zeros (missing walls). The marks are clamped to the table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017V7WBCi8h4eymnRhdth77t
Closes #284.
What
A list whose shaders could store through title memory by address declared every numbered copy written. Declaring a copy written costs a snapshot of its bytes before the submission and a compare after it (
shadow.rs). In the prologue with the structure builder on, 1,023 copies are numbered (the limit), 4.3 GB, and three to four lists a frame declared all of them: a frame took 3.2-3.4 s, of which about 2.8 s were those snapshots and compares. The module's comment already named the remedy ("a dirty-page mask written by the shader would bound both").This PR does the copy-granular form of it:
Shader (
Lower::memory): every store and atomic through a copy also sets that copy's mark, dwordMEMORY_FAULTS + nof the buffer the fault notes already live in (MEMORY_MARKS = 1024dwords after them). A plain store of 1, so no atomic; lanes that do not run write the sink. Loads do not mark.Host (
memory.rs): the marks are read and cleared once a frame, with the faults. A list that can store declares written onlyEach copy at most once per list.
mapandnamereturn the copy's index for this.No new root parameter, no change to
draw.rs, the pipeline code or the shader interface beyond the longer buffer. The translation changes, so cached translations of these programs are redone (the build fingerprint does that).The shortcut it takes
The first store to a copy that none of the three rules holds is not copied back to title memory: its mark brings the copy in from the next frame the marks are read in. That is the loss a page without a copy already has, for a frame or two. The host logs how many copies that happened to (
shaders stored to copies no list had declared written), 50 lines at most.Measured
RTX 5080 16 GB (32-lane waves), Windows 11, diag build, Series X profile,
VICTORY_SHADER_LOOP_LIMIT=256, warm caches, scripted Enter, 300 s runs. The builder numbers are with #156 merged locally, because on a 32-lane card the builder does not start without it; this branch itself is onmain(2119b0e) and does not need #156.Builder on (
VICTORY_BVH_BUILDER=1 VICTORY_BVH_QUARANTINE=1), per frame, from each run's last reports:The marks named 38 of the 1,023 copies in the first frame they were read, then 1 to 5 new ones a frame.
Builder off (defaults), this branch on
mainagainstmain: 375-418 ms a frame against 416-422 ms, no device loss and no title crash in 300 s either way. So nothing moves in a normal run.Tested
cargo test --release -p victory-shader -p victory-gpu: 110 + 210 passed, 0 failed, on this branch and with Ray tracing: shadow-ray traces and the full structure builder translate on 32-lane GPUs #156 merged.cargo clippy --release -p victory-shader -p victory-gpu: no warnings. The files this touches are rustfmt-clean where this touches them (the tree as a whole is not, so I did not run it over the crates).What I could not test
VICTORY_BVH_BUILDER=1and no quarantine the title crashes about 5-7 s after the builder starts, at the same addresses with and without this change (+0x27c195d,+0x2bd385b,+0x4f38ba5,+0x4e335b4,+0x8f92a): the crash of Ray-tracing builder runs on an RTX 5070 (32-lane) - then the title crashes on f16 box bounds #16. Until that is fixed, a store this PR's shortcut drops for a frame cannot be told from the builder's own trouble.VICTORY_RELAY/VICTORY_LATE_WAITthe marks are read while earlier submissions may still run. A mark set after the read is found the next frame, and the 8-frame window is there for that; I did not run those modes.Relation to other PRs
pub uselist overlaps and merges by hand); the measurements above need it.readytracks, per list, which copies it refreshed and declared. This PR replaces thefirst_writerule that GPU: track numbered title-memory copies per command list in memory::ready (#16) #205 reworks with a per-copy key, so the two conflict in that loop. I am glad to rebase onto GPU: track numbered title-memory copies per command list in memory::ready (#16) #205 if it goes in first.Not in this PR: the limit of 1,023 copies (the log says
no number left for another copy; its pages read zerosin the prologue), the washed-out picture with the builder on, and #16.AI-assisted (Claude Code). No game data: counts, timings and log lines only.
🤖 Generated with Claude Code
https://claude.ai/code/session_01TydV9AGmPCiUTkG8rHubBQ