Shaders: one lane of a wave sets a mark its wave shares (frames 411 -> 283 ms on an RTX 4070 SUPER) #2956
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2958"
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 Marvisak/VIctory. Originally posted by moe-miau on 2026-11-26T01:30:35Z.
Problem
Every store through a heap view sets its 64 KiB page's bit in the write-mark bitmap, and every heap-direct texture read sets its slot's read mark (
Lower::mark_view_write,Lower::mark_view_read). Each is a load of the bitmap word, plus an atomic OR where the bit is clear. The bitmap is ashared_bufferin system memory, because the CPU reads and clears it after each submission. So each of those loads crosses the bus, once per lane, for every marked store or read.Most lanes of a wave write the same page or read the same slot. On an RTX 4070 SUPER the passes that store the most were far slower than the same passes in other trees: a 1.5M-thread clear of three R32_UINT buffers (
a7eeed0646be1ab7) took 20-41 ms.Codex pointed at the mark traffic. I confirmed it by moving the bitmap into video memory (GPU upload heap) in a local build. GPU time dropped sharply (
b58eb3ca6ee46427: 236 → 11 ms per dispatch), but CPU copy-back went to 2.8 s a frame, because the CPU's reads of that memory are uncached. So the bitmap stays where it is, and fewer lanes touch it.Change
A lane whose mark bit equals the leading lane's leaves the load and the atomic to that lane; lanes with other bits still set their own (new
lower/marks.rs, solower.rsstays under the asset-policy size limit). The leading lane is the first active one (waveReadLaneFirst,waveIsFirstLane), and in pixel shaders the first that is no helper, since a helper's writes are dropped (lowest lane index among non-helpers bywaveActiveOpmin, thenwaveReadLaneAt).Tested
RTX 4070 SUPER, driver 32.0.16.1742, Windows 11 26300. Title 1.0.2.1, Series X profile, diag build, scripted Enter presses, 15-minute runs. Tree:
mainf3578e3+ #2464 + #2098 + #2626 + #2628 + #2711 + #2851 + #2705 (VICTORY_CARD_COPIES=1) + #2925, then + this.No device removal in any run. Picture at the same scripted moments matches the run without this PR (the prologue cell).
victory translate --validateon the light-volume pixel shader (a885ba5d98ce46bf) and the clear (a7eeed0646be1ab7): both validate.writes_through_views_mark_their_pagesandstraddling_writes_across_256mib_and_4gib_boundaries_mark_exact_pages(they check marks on the GPU): pass.cargo test -p victory-shader --lib --skip heap_direct_texture_reads_mark_their_heap_index: 298 passed, 3 failed: the same three asmainon NVIDIA (a_heap_buffer_read_by_element_takes_the_views_stride,a_heap_buffer_read_where_no_buffer_view_is_reads_zeros,gathers_at_a_level_match_the_hardware). The skipped test crashes the process onmainhere too (#2571).cargo clippy --workspace --all-targets --locked -- -D warnings: clean.cargo xtask policy: ok.AI-assisted (Claude Code; diagnosis with Codex). Runs done on my machine.
🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:59:27Z.
Review: COMMENTED
Reviewed and tested updated commit
2b48889aagainstmain(63bcca43) on Windows 11 (RTX 5090 + WARP +dxil.dll). The non-pixel path (waveReadLaneFirst+waveIsFirstLanewith(n != f) || first) is clean, splitting the helper intoemit/lower/marks.rskeepsemit/lower.rssafely below the 512 KiB cap (520,878 B), andemit::memory_testspass (4/4, skipping the pre-existing Win11 WARPheap_direct_texture_reads_mark_their_heap_indexcrash).One edge case to address in the newly added pixel-shader branch (
crates/victory-shader/src/emit/lower/marks.rs:19-45):waveReadLaneAtlane index (u32::MAX) on all-helper waves:mark_lead(n)with only helper lanes active (for instance, in unguardedmark_view_read, or afterdiscard/divergent control flow where only helper lanes remain in the block), every lane produceskey = u32::MAX, sowaveActiveOp.i32(min, unsigned)returnslead = 0xFFFF_FFFF.lead = 0xFFFF_FFFFtodx.op.waveReadLaneAt.i32(n, lead)(marks.rs:38-44) is an out-of-bounds lane index (undefined behavior in DXIL/D3D12), and if the undefinedfdiffers fromn, helper lanes will also fall through and execute the system-memory bitmap load (raw_dword).leadto0whenlead == u32::MAX, and returningfalsefor helper lanes via!helper && (differ || first)since helper-lane writes are dropped anyway) avoids both UB and unnecessary helper-lane bitmap traffic.mark_leadunderdxil.dlland GPU execution.Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T02:01:58Z.
Review: APPROVED
Tested merged onto
origin/main(63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP,dxil.dllvalidator active):cargo test -p victory-shader --lib emit::memory_tests -- --skip heap_direct_texture_reads_mark_their_heap_index: 4 passed, 0 failed (includingwrites_through_views_mark_their_pageson RTX 5090 hardware + WARP).VICTORY_WARP=1 cargo test -p victory-shader --lib emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index: 1 passed, 0 failed (pre-existing#2571skips hardware run on NVIDIA).cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 192 files ok.The wave-coalescing logic in
Lower::mark_leadis sound: in non-pixel shaders,waveReadLaneFirst(n)+waveIsFirstLane()lets one active lane handle the common bit while any lane withn != fstill marks its own bit; in pixel shaders, selecting the minimum non-helper lane index avoids delegating a write mark to a helper lane whose UAV atomic would be dropped.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T02:24:10Z.
Review: COMMENTED
Verified: one lane per wave does the bitmap load+atomic instead of all 32 — the dedup rule (lane marks iff it leads OR its bit differs from the lead's) is exactly right. Pixel path correctly excludes helper lanes via isHelperLane+waveActiveOp(min)+waveReadLaneAt, non-pixel uses waveReadLaneFirst/waveIsFirstLane. Setting WAVE_OPS flag is necessary and done. re-binding c after begin_guarded matches the surrounding idiom.
Imported from Marvisak/VIctory. Originally posted by steven-seagull27 on 2026-11-26T02:31:03Z.
@moe-miau @fuzeofficlal I exercised both cases from the review on
2b48889a, with synthetic guest instructions and GPU readback of the actual write-mark bitmap.Compute. Group sizes were 1, 3, 7, 31, 32, 33, 63, 64 and 65. Lanes whose thread ID is a multiple of four skip the store, including thread 0. The remaining three classes write different 64 KiB pages of one view, crossing a bitmap-word boundary at bits 31–33. For 3 threads, bits 31 and 32 were set. For 7 threads, bits 31, 32 and 33 were set. All nine cases also passed with fixed-width compute shaders on RTX Wave32, built-in WARP Wave4, and portable WARP Wave4/32/64. A control that kept only the leader lost bit 32 in the 3-thread dispatch on all three adapters, even though both stores landed.
Pixel. Four draws each covered one pixel, moving it through all four corners of the same quad. A fifth triangle put its edge through several quads and covered 21 pixels. Each covered pixel did a bounded UAV atomic add. The counts were
1, 1, 1, 1, 21, and exactly page bit 31 was set on every draw. A control that selected physical lane zero lost the mark on the top-right single-pixel draw on all three adapters; the color and atomic count still showed the draw executed. These draws cover mixed real/helper quads. They cannot observe what an all-helper wave computes for its source index, so the reviewer's range-guard question remains open.Compute regression ead53d4 and pixel regression dc84e33. The second commit adds test-host readback for graphics UAVs. To run both from this PR head:
The shader crate passed Clippy with warnings denied. These are correctness readbacks; I didn't measure frame time.
Follow-up for the helper-lane review. Source-only commit 3c30d80 elects the pixel leader inside
!isHelperLane, usingWaveReadLaneFirstandWaveIsFirstLane. I checked the emitted pixel DXIL: helpers bypass the election, providefalseat the join and skip the bitmap load/atomic. The marker emits no indexed lane read, so an all-helper wave has no source index to clamp. The RTX and both WARP versions still passed all five pixel draws. A second version of the 21-pixel triangle sent alternate columns to two pages; all three adapters returned 9 and 12 atomic increments and exactly bits 31 and 32 both before and after the change. The nine compute groups, original write-mark test and strict Clippy also passed on the candidate. I haven't measured the extra branch on a game frame.The source commit cherry-picks independently of the test commits:
Imported from Marvisak/VIctory. Originally posted by moe-miau on 2026-11-26T04:26:21Z.
@fuzeofficlal Good catch, fixed in
1f9c4b3: a helper's key is now its lane with bit 30 set, so the minimum is the first non-helper, or in an all-helper wave a helper no lane matches as leader, andwaveReadLaneAtreads at that key with bit 30 masked off (a lane that exists). The light-volume pixel shader still validates (victory translate --validate), and the two GPU mark tests pass.@steven-seagull27 @Dukestar69 @kotekompotek thanks for the runs and the review.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T05:28:40Z.
Automated triage for the maintainers.
This cuts down write- and read-mark traffic to the system-memory bitmap. In
Lower::mark_view_writeandLower::mark_view_read, the bitmap load and atomic now sit behindmark_lead(newemit/lower/marks.rs). A lane skips them only when its mark bit equals that of the leading lane, so every distinct bit is still set by at least one active lane. The marks themselves don't change. In compute, the leader is the first active lane (waveReadLaneFirst/waveIsFirstLane). In pixel shaders, it is the first non-helper lane, picked with a keyedwaveActiveOpminimum.1f9c4b3fixes the all-helper case, so the read-lane index always names a real lane. Keeping it in a submodule keepslower.rsunder the policy size limit. CI: passing.One suggestion: @steven-seagull27's GPU readback tests for partial groups and partially covered quads (
ead53d4,dc84e33, linked in the thread) would pin this behaviour in the repo. Pulling them in would be worthwhile.Verdict: merge candidate. Recommending a look, not approving.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by walterwallaceson on 2026-11-26T05:52:28Z.
RTX 3070 8 GB, Windows 10: GPU time goes down as intended (~370 → 260-290 ms a frame), but the frame gets 2-3× slower overall. Copy-back rises from ~60 to 470-690 ms a frame, and host copies run at about a fifth of their usual throughput. Two runs each.
Setup: RTX 3070 8 GB, driver 621.14, Windows 10 22H2 (19045).
main63bcca4+ #463 (Agility runtime, needed on Windows 10) + #2626, then + this PR at1f9c4b3. Diag build, Enter scripted at 17, 30 and 60 s, nothing skipped. Averages over minutes 5-10 of each run, from the frame-rate lines:7dcc595,VICTORY_CARD_COPIES=1)No device removal or errors in any run. The amount copied is the same with and without the PR. What changes is the time: the copies and the copy-back both slow down while barely any more data comes back.
Your tree had #2705 with
VICTORY_CARD_COPIES=1, so I added it (last row; the log shows card copies on, 7.5-8.6 MB a frame up). That brings GPU time down further, but copy-back stays around 360 ms and the frame is still about twice as slow as without this PR. Your tree also had #2098/#2464/#2628, which ours doesn't, so one of those may be what keeps copy-back short there.Not tested: why the copy-back slows (no profile); #2705 without this PR on this card (running now); a third run; the picture.
No game data attached. I'm testing with Claude's help, and Claude drafted this comment.
Imported from Marvisak/VIctory. Originally posted by walterwallaceson on 2026-11-26T06:20:30Z.
Correction to my comment above: don't count the slowdown against this PR yet. A control run of the exact tree I called "without this PR" (
main63bcca4+ #463 + #2626, same binary as the 1.79 fps run) came out at 0.93 fps, with copy-back at 280 ms, about the same as the runs with this PR. On this RTX 3070, frame rate swings between roughly 0.7 and 1.8 fps from run to run of the same build, for a reason I haven't found yet (the memory use and draws per frame look alike). My two "without" runs happened to be fast ones.What still holds: GPU time per frame was lower in every run with this PR (211-293 ms against 333-383 without), which is the part this PR changes. I'll come back with numbers once I can measure the run-to-run spread on this card.
I'm testing with Claude's help, and Claude drafted this comment.
Imported from Marvisak/VIctory. Originally posted by MeMako on 2026-11-26T07:00:43Z.
Verified
#2958(1f9c4b3) on AMD RDNA 4 (Windows 1110.0.26200, Ryzen 9 7950X, RX 9070 XT, driver32.0.32029.2010, 32 GB RAM).Tests
cargo clippy -p victory-shader -p victory-gpu -p victory --all-targets --locked -- -D warnings: clean.cargo test -p victory-shader --lib --locked: 305/305 passed, 0 failed — including all 3 GPU mark tests (writes_through_views_mark_their_pages,straddling_writes_across_256mib_and_4gib_boundaries_mark_exact_pages, andheap_direct_texture_reads_mark_their_heap_index).victory translate --cache(0 crashes / 0 regressions).Live Title Verification (RX 9070 XT)
main63bcca4+#2051+#2472+#2918+#1010+#2130with VRAM upload flags off +#3055+#2914+#2985+#2849+#3035), before vs. after merging#2958(n=65world /n=53heavy frames vs.n=54/n=38baseline).>=4kdraws): median 166.9 → 162.2 ms, avg 194.7 → 169.9 ms (-24.8 ms on streaming spikes)290 → 151 mson RTX 4070 SUPER), RDNA 4's L2 + Infinity Cache already kept GPU time near ~162 ms before this PR, so the steady-state GPU delta on RX 9070 XT is small (-4.1 ms) with stronger improvement on heavy spikes (-24.8 msavg) and zero regressions.Hardware runs were performed by me on my 7950X / RX 9070 XT; comment drafted with Antigravity.
Imported from Marvisak/VIctory. Originally posted by neonbyte1 on 2026-11-26T16:58:33Z.
In-game measurements of this PR on an RTX 5090 (driver 620.73.04), Linux, GE-Proton11-14 Wine with its vkd3d-proton, GTA VI's lit prison yard after the opening.
Setup:
mainplus a few unmerged PRs needed on this setup (#2723, #439, #2118, #2703, #2101, #2312 and others), with this PR (1f9c4b3) merged on top. No conflicts.diagbuild.VICTORY_GPU_TIMING=1 VICTORY_D3D12_DRED=1, giving per-command GPU time.Untimed (what a player would see):
That's 23% less frame time. No device removal, Xid or refused pipeline in either run, and the yard renders the same.
Timed:
[mesh b7a81f5b96f4ca93, pixel 43e24028d4a1faef](G-buffer, 151 draws/frame)CS_ResetTilesMask(a7eeed0646be1ab7)How much the marks cost: before finding this PR, I measured the marks themselves with a measurement-only switch that turns view marks off; that breaks copy-back, so it's for measurement only. The same frame took 251 ms of GPU command time with marks off, against 579 ms with per-lane marks. So on NVIDIA the marks cost about 320 ms/frame, and this PR recovers most of it (346 ms). The marks bitmap here is in system memory (CUSTOM heap, WRITE_BACK, L0), which is why #2465's video-memory bitmap looks complementary. That's untested here so far.
Same approach, independently: I'd written a wave-coalesced version independently (a vote on the bitmap word, then one atomic of the OR of the lanes' bits). It measured 352 ms of GPU commands and 9.0 ms for the G-buffer pair, so slightly behind this PR. I'm not posting it. I also wrote a GPU test that compares coalesced marks with per-lane marks word for word: preset bits, divergent branches, lanes on the same and on different words. It passes on this PR's lowering, together with your
writes_through_views_mark_their_pagesand the 256 MiB/4 GiB straddling test, under Wine on the RTX 5090 and on WARP. It currently builds only on my test base; I'm adapting it tomain+ this PR and will link it here if you want it.This also explains the per-draw NVIDIA cost in #3028: the same G-buffer pair is the top entry there.
AI-assisted (Claude); measured on my machine, no game data shared.
Imported from Marvisak/VIctory. Originally posted by neonbyte1 on 2026-11-26T17:02:02Z.
The GPU test I mentioned now builds on
main+ this PR alone:test/2958-bitmap, one test-only commit1fee6b7on top of your1f9c4b3. Feel free to cherry-pick it.wave_coalesced_marks_equal_per_lane_marks_on_the_gpulowers the same program twice, once as is and once with the leader election disabled through a#[cfg(test)]hook inlower::marks, and compares the written bitmaps word for word.Root::UavDatais a small addition to the test host that presets a root UAV.--all-features), policy and formatting are clean.AI-assisted (Claude); measured on my machine, no game data shared.
Imported from Marvisak/VIctory. Originally posted by moe-miau on 2026-11-27T02:36:23Z.
@neonbyte1 thanks, I took
1fee6b7as is, with your authorship kept.wave_coalesced_marks_equal_per_lane_marks_on_the_gpupasses here on an RTX 4070 SUPER (Windows, native D3D12) too. Policy is clean.Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-27T09:03:19Z.
Intel Arc B580 (Battlemage), Windows 11:
CS_ResetTilesMaskgoes 1,866 → 57 ms a frame, frame 4,734 → 1,299 msNo Arc report in the thread yet (I checked: none of the comments mention Arc/Intel/Battlemage), so here is one,
and on this card the mark path is a larger share of the frame than in the reports above.
Setup: Windows 11 x64, Intel Arc B580 12 GB (driver default), Ryzen 5 5600, 32 GB, retail 1.0.2.1, my own
dump,
--console series-x,diagbuild, caches warm for both runs, 230 s each.mainis63bcca4; the PR'sthree commits (
4f99be41) are applied on top as a patch — the branch shares no history withmain, sogit diff 4f99be41~3 4f99be41was applied withgit apply --3way, which took all four files cleanly.One recipe note that matters for reproducing any of this: the per-command breakdown needs
VICTORY_GPU_TIMING=1andVICTORY_D3D12_DRED=1.HostList::noteis gated ondred_on()(
host.rs:2009), so with timing alone the report printslists 3959.2 ms/frame of wall time, their commands 0.0 ms/frameand names no pass — which is how I first missed that one dispatch was half the frame.GPU command time, median of the last 6 world-phase reports of each run:
main63bcca4dispatch [compute a7eeed0646be1ab7]=CS_ResetTilesMask, 1 command/frameThat dispatch is 45% of the whole frame on
mainhere, and 33x cheaper with the PR — the largest share of anyreport in this thread, which is what makes it worth posting: on Battlemage the per-lane mark path is not a
modest slice, it is the frame.
slow list command, 1476.3 ms: dispatch 23400x1x1 [compute a7eeed0646be1ab7]on
mainis the same finding from the list side.The dispatch is
23400x1x1in both runs, same hash, same count, so the comparison is the same work; thedraws/framediffer by 11% because the two runs catch the intro at slightly different points, so read theframe-level rows as ±10% and the
CS_ResetTilesMaskrow as the solid one.cargo test -p victory-shader --lib wave_coalesced_marks_equal_per_lane_marks_on_the_gpu -- --test-threads=1passes on the B580 (0.25 s), so the coalesced marks do equal the per-lane marks on this hardware. I did not
capture frames in these two runs, so I am not claiming anything about how the scene looks beyond that test.
Synthetic tests only for the test; the run numbers are from my own dump, no game data included.
Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-27T09:20:09Z.
Follow-up on the picture, not the timings: with this PR the world reaches an actual scene on the B580, and it did not before
Two captures from the same dump and console (series-x), same 12 GB Arc B580,
VICTORY_CAPTURE+VICTORY_CAPTURE_WORLD, counted from the first frame with 500 or more draws:main63bcca4: the world frames are a blown wash — left band mean rgb (216,210,213), sky (212,216,215),a faint magenta cast and faint silhouettes on the right (55,65,85), tile seams. No lights, no lit surfaces.
main+ this PR: the world develops past a short fade (solid clear → black → white) into a scene: a car inthe foreground, a bridge and its railing, distant city lights, sky and cloud. Mean rgb (90,87,90) at world
frame +128, and the world's first frame drew 14,239 draws against 7,392 on
main.I want to be careful about what this proves. It is not a controlled same-frame A/B: with the PR the frame
is 1,298 ms against 4,734 ms, so in the same wall-clock time it reaches much further into the scene, and on
mainreaching world frame +128 would take about ten minutes rather than two and a half. What I can say isthat across the wall-clock windows I have watched and captured (about four minutes each),
mainstayed apink wash and the patched build produced the lit scene above. A same-phase A/B is still owed and I can run it.
That the picture changes at all is plausible from the mechanism rather than surprising: these are the marks
the GPU's writes are tracked by, so a mark that names the wrong pages also gets the wrong bytes copied back,
and the title then samples corrupted data. The scene is far from correct on this card — heavy tile and
composite misalignment, letterboxing, and the alpha-blended regions overlap — but "bugged, and a scene" is a
different state from "a wash".
One unrelated thing, reproducible twice: both runs with this PR applied ended in
memory allocation of 3686400 bytes failedandmemory allocation of 1048576 bytes failedtwo to fourminutes into the world, on a 32 GB machine with the working set around 19 GB.
mainnever showed it here, butmy
mainruns are killed at 230-260 s by their own timeout, so I am not blaming the PR — just flagging thatthe patched build now survives long enough to reach whatever the ceiling is, and a failing 1 MB allocation is
worth a look on its own.
Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-27T10:26:29Z.
On my Intel Arc B580 this PR now correlates with GPU device removals — 3 of 4 runs against 0 of 4 on
main, with fewer frames presentedI have to report this after the timing verification I posted earlier, because it is the kind of thing that
should not sit unmentioned in a PR that looks like a clear win.
Setup: rebuilt and rebooted since my earlier numbers (clean driver, pagefile raised, commit limit 63 GB), so
these are fresh-machine runs. Windows 11 x64, Intel Arc B580 12 GB, Ryzen 5 5600, 32 GB, retail 1.0.2.1, my own
dump,
--console series-x,diagbuild,VICTORY_GPU_TIMING=1 VICTORY_D3D12_DRED=1, 110 s each.main63bcca4alonemain+ this PR (4f99be41)main+ this PR + #3312The frame column is the point: the patched builds presented fewer frames in those windows than
maindid, andstill faulted, so this is not simply more work getting more chances to fail.
Signature, identical in all four faults:
f000:0x800019bdf000,0x80002507f000,0x80000d7cf000,0x800001dff000— the same 4 KiB page inside a 64 KiB block each timeland at
0xffffb802…, so this is not an over-read of one of thoseWhat I am not claiming: n=4 per tree on one machine and one vendor, and intermittent, so this needs
reproduction before anyone treats it as settled. It could also be an Intel driver reaction to something in the
mark path rather than a wrong mark.
What I can do next, whichever helps you: bisect the two functional commits (
2b48889avs1f9c4b37), runthis build on WARP for a vendor-independent read, or attach the full log of a faulting run. The marks change is
otherwise a large, clean win on this card — 4734.3 -> 1298.8 ms/frame and
CS_ResetTilesMask1866.2 -> 56.8 ms— and the world goes from a pink wash to an actual scene, so I would rather this were understood than buried.
Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-27T10:43:27Z.
Short addendum: this fault is not specific to this PR — Belobug's AMD fork (
VIctory-Belobug-AMD,a-publier, a lineage that does not contain these commits) removed the device on my card today as well, withVICTORY_D3D12_DRED=1and before the world: same signature, a page fault in0x8000…with no title copy below it.So the honest reading of my earlier table is that the fault lives in the shared base and my 3-of-4 against 0-of-4 was too small a sample to hang on this PR — I would not treat it as a blocker for #2958. I will follow up with the maintainers as a separate issue instead. The timing and picture results above are unaffected.
Imported from Marvisak/VIctory. Originally posted by moe-miau on 2026-11-27T11:16:15Z.
@borosf thanks for the Arc B580 runs: the first Intel numbers in this thread, and the picture result is useful. Thanks also for following up on the device removals: if the same page-fault signature shows up on a tree without these commits, that points at the shared base, and a separate issue is the right place for it. If you open it, link it here and I'll test it on NVIDIA.
Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-27T11:25:08Z.
@moe-miau filed as you suggested: the Arc B580 device-removal signature now lives in #2671, not here — including the point that the same page-fault removal appears on a fork lineage without these commits, so it is a base-level Intel thing and not evidence against this PR.
One detail from that write-up that is worth having in this thread, because it bears on the PR's own bucket: the list DRED blames is a
16x1x1compute dispatch,9146291b38ea9ce1, and that dispatch is also the largest single bucket in my frame timings (171 ms of 765 ms of GPU time in the world, after this PR). The removals land on lists that also drop mesh draws for want of dynamic slots, i.e. the capped-heap starvation tracked in #3419 — so the marks change here is upstream of neither problem, which is the reading I want on record.For the review itself: I read the election and could not break it. Skipping a lane is only safe because the whole block is an idempotent set of the shared bit — the atomic's return is unused, and
differ || firstkeeps the leader plus every lane whose bit differs from the leader's, so no bit is lost even though it does not fully collapse a second distinct bit in the same wave. The all-helpers case reading back a helper lane is fine because its write is dropped anyway, andwaveActiveOponly ever elects an active lane, sowaveReadLaneAtnever targets an exited one. The bit-for-bit test against the per-lane path is the right guard for this.Imported from Marvisak/VIctory. Originally posted by Desamodeth on 2026-11-27T12:44:03Z.
Native Windows, RTX 5070 12 GB (621.40), Series X profile, opening car sequence. Compared
63bcca43+ #2885 against the same tree + #2958 (4f99be41). The source differences matched this PR. Each launch restored the same save and its build's fixed application-cache seed. The driver cache persisted.After one cache-seeded warm-up of each build, the next four successful runs were B/A/A/B. We used 96 common successful Present intervals per run at world offsets +32…+135, excluding each capture and the following interval.
The fixed 25–65 s window after the world marker also favored the PR in both pairs (median 610 → 519 ms and 614 → 584 ms). The initial cache-seeded pair went the other way (642 → 666 ms) and had much more pipeline waiting. Camera cuts and credits varied at matched frame numbers, so this is evidence for the opening sequence on this stack, with limited precision for identical rendered work. One cold run returned
DXGI_STATUS_OCCLUDED; one control exited before the world marker. Both are excluded.Also ran the PR head's
wave_coalesced_marks_equal_per_lane_marks_on_the_gpu: both hardware and WARP reported bit-for-bit equality. AI-assisted with Codex.Imported from Marvisak/VIctory. Originally posted by rpmaster2 on 2026-11-27T18:16:30Z.
RDNA4 (RX 9070 XT): this head crashes the host during startup, 2 runs of 2, same address.
What happens
0xc0000005in the host binary, read of0x30, no Rust panic message before it:Both runs die at the same RVA, at about 80 s and 100 s after launch respectively, while the title is still on its early screens (10-11 draws a frame, 30 fps), right after a compute shader was translated and a host pipeline for it was being made. The last log lines before the fault are a
host pipeline library saved, ashader translated stage="compute" hash=…, and the title's own crash reporter starting its upload — so the crash is in our process and the title notices it.Setup
4f99be4,cargo build --locked --profile diag -p victory --features diagnostics(25.6 s)--console series-x,VICTORY_PRESENT_TARGET=1x1:1, scripted keys, same dump and save for every runRun 1: private 13.6 -> 18.9 GB at 60 s, page file 1.07 GB, fault at 80 s.
Run 2: private 15.8 -> 20.3 GB at 80 s, page file 1.25 GB, fault at 100 s.
Control on the same machine
main63bcca4, built the same way, same save and caches: it reached the world and rendered it — 1.5-2.0 fps, 506-686 ms/frame, 1,809-3,464 draws a frame, copies 60-337 ms / 118-731 MB, private 26.2-27.6 GB. It ended on its own at 220 s without an exception in the log (which I cannot explain either, but it is the silent kind of exit this machine also produces onmain; it is not this PR's fault and I mention it so the control is not read as a clean 300 s).So the difference I can point at: on
mainthis card renders the world before anything ends; on this head it faults in the host at the same address twice in a row, before the title is out of its first screens.Where I would look
The fault is a read of
0x30from a null-ish base — a struct or slice field on a missing object — rather than an out-of-bounds index. The PR's own new code iscrates/victory-shader/src/emit/lower/marks.rs(the leader election for wave marks) plus small changes inemit/host.rsandemit/lower.rs, and both runs die while a compute program is being translated or its pipeline made, which is exactly that path. I have no symbolizer on this machine (llvm-symbolizer/addr2lineare not installed), so+0x247303is all I can give you — with your PDB it should name the file and line in a minute.If it helps: I can rebuild this head with
debug = 2for the whole workspace (orpanic = "abort"off) and get a stack from the crash reporter, or add adebug_assert!around the mark code you suspect and run it here — I have the card and the warm caches, so it is a 40-minute loop per attempt.AI-assisted: written by DeepSeek (OpenCode harness) from my run logs; counts and versions only, no game files or paths.
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.