Shaders: one lane of a wave sets a mark its wave shares (frames 411 -> 283 ms on an RTX 4070 SUPER) #2956

Open
moe-miau wants to merge 3 commits from upstream-pr/2958 into main
moe-miau commented 2026-11-26 01:30:35 +00:00 (Migrated from github.com)

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 a shared_buffer in 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, so lower.rs stays 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 by waveActiveOp min, then waveReadLaneAt).

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: main f3578e3 + #2464 + #2098 + #2626 + #2628 + #2711 + #2851 + #2705 (VICTORY_CARD_COPIES=1) + #2925, then + this.

ms per frame (last samples) on the GPU fps over the last 12 min
without this PR 411-414 290-292 2.4-2.5
with this PR, run 1 323-331 198-208 3.0
with this PR, run 2 ~330 2.9-3.1
with this PR incl. pixel shaders (head) 281-283 151 3.3-3.6

No device removal in any run. Picture at the same scripted moments matches the run without this PR (the prologue cell).

  • victory translate --validate on the light-volume pixel shader (a885ba5d98ce46bf) and the clear (a7eeed0646be1ab7): both validate.
  • writes_through_views_mark_their_pages and straddling_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 as main on 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 on main here 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

<!-- greyfinch-sync:Marvisak/VIctory:issue:5502283324 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958). Originally posted by [moe-miau](https://github.com/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 a `shared_buffer` in 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`, so `lower.rs` stays 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 by `waveActiveOp` min, then `waveReadLaneAt`). ## 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: `main` `f3578e3` + #2464 + #2098 + #2626 + #2628 + #2711 + #2851 + #2705 (`VICTORY_CARD_COPIES=1`) + #2925, then + this. | | ms per frame (last samples) | on the GPU | fps over the last 12 min | |---|---:|---:|---| | without this PR | 411-414 | 290-292 | 2.4-2.5 | | with this PR, run 1 | 323-331 | 198-208 | 3.0 | | with this PR, run 2 | ~330 | | 2.9-3.1 | | with this PR incl. pixel shaders (head) | 281-283 | 151 | 3.3-3.6 | No device removal in any run. Picture at the same scripted moments matches the run without this PR (the prologue cell). - `victory translate --validate` on the light-volume pixel shader (`a885ba5d98ce46bf`) and the clear (`a7eeed0646be1ab7`): both validate. - `writes_through_views_mark_their_pages` and `straddling_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 as `main` on 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 on `main` here 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](https://claude.com/claude-code)
fuzeofficlal commented 2026-11-26 01:59:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:59:27Z.

Review: COMMENTED


Reviewed and tested updated commit 2b48889a against main (63bcca43) on Windows 11 (RTX 5090 + WARP + dxil.dll). The non-pixel path (waveReadLaneFirst + waveIsFirstLane with (n != f) || first) is clean, splitting the helper into emit/lower/marks.rs keeps emit/lower.rs safely below the 512 KiB cap (520,878 B), and emit::memory_tests pass (4/4, skipping the pre-existing Win11 WARP heap_direct_texture_reads_mark_their_heap_index crash).

One edge case to address in the newly added pixel-shader branch (crates/victory-shader/src/emit/lower/marks.rs:19-45):

  • Out-of-range waveReadLaneAt lane index (u32::MAX) on all-helper waves:
    • When a pixel-shader wave reaches mark_lead(n) with only helper lanes active (for instance, in unguarded mark_view_read, or after discard/divergent control flow where only helper lanes remain in the block), every lane produces key = u32::MAX, so waveActiveOp.i32(min, unsigned) returns lead = 0xFFFF_FFFF.
    • Passing lead = 0xFFFF_FFFF to dx.op.waveReadLaneAt.i32(n, lead) (marks.rs:38-44) is an out-of-bounds lane index (undefined behavior in DXIL/D3D12), and if the undefined f differs from n, helper lanes will also fall through and execute the system-memory bitmap load (raw_dword).
    • Guarding the lane index (e.g., clamping lead to 0 when lead == u32::MAX, and returning false for helper lanes via !helper && (differ || first) since helper-lane writes are dropped anyway) avoids both UB and unnecessary helper-lane bitmap traffic.
  • Adding a pixel-shader test (with helper lanes or a partial quad) plus a divergent-lane test writing two distinct pages/slots would also directly cover both branches of mark_lead under dxil.dll and GPU execution.
<!-- greyfinch-sync:Marvisak/VIctory:review:6067549825 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#pullrequestreview-6067549825). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T01:59:27Z. **Review:** COMMENTED --- Reviewed and tested updated commit `2b48889a` against `main` (`63bcca43`) on Windows 11 (RTX 5090 + WARP + `dxil.dll`). The non-pixel path (`waveReadLaneFirst` + `waveIsFirstLane` with `(n != f) || first`) is clean, splitting the helper into `emit/lower/marks.rs` keeps `emit/lower.rs` safely below the 512 KiB cap (`520,878 B`), and `emit::memory_tests` pass (`4/4`, skipping the pre-existing Win11 WARP `heap_direct_texture_reads_mark_their_heap_index` crash). One edge case to address in the newly added pixel-shader branch (`crates/victory-shader/src/emit/lower/marks.rs:19-45`): - **Out-of-range `waveReadLaneAt` lane index (`u32::MAX`) on all-helper waves**: - When a pixel-shader wave reaches `mark_lead(n)` with only helper lanes active (for instance, in unguarded `mark_view_read`, or after `discard`/divergent control flow where only helper lanes remain in the block), every lane produces `key = u32::MAX`, so `waveActiveOp.i32(min, unsigned)` returns `lead = 0xFFFF_FFFF`. - Passing `lead = 0xFFFF_FFFF` to `dx.op.waveReadLaneAt.i32(n, lead)` (`marks.rs:38-44`) is an out-of-bounds lane index (undefined behavior in DXIL/D3D12), and if the undefined `f` differs from `n`, helper lanes will also fall through and execute the system-memory bitmap load (`raw_dword`). - Guarding the lane index (e.g., clamping `lead` to `0` when `lead == u32::MAX`, and returning `false` for helper lanes via `!helper && (differ || first)` since helper-lane writes are dropped anyway) avoids both UB and unnecessary helper-lane bitmap traffic. - Adding a pixel-shader test (with helper lanes or a partial quad) plus a divergent-lane test writing two distinct pages/slots would also directly cover both branches of `mark_lead` under `dxil.dll` and GPU execution.
Dukestar69 commented 2026-11-26 02:01:58 +00:00 (Migrated from github.com)

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.dll validator active):

  • cargo test -p victory-shader --lib emit::memory_tests -- --skip heap_direct_texture_reads_mark_their_heap_index: 4 passed, 0 failed (including writes_through_views_mark_their_pages on 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 #2571 skips 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_lead is sound: in non-pixel shaders, waveReadLaneFirst(n) + waveIsFirstLane() lets one active lane handle the common bit while any lane with n != f still 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).

<!-- greyfinch-sync:Marvisak/VIctory:review:6067567270 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#pullrequestreview-6067567270). Originally posted by [Dukestar69](https://github.com/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.dll` validator active): - `cargo test -p victory-shader --lib emit::memory_tests -- --skip heap_direct_texture_reads_mark_their_heap_index`: **4 passed, 0 failed** (including `writes_through_views_mark_their_pages` on 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 `#2571` skips 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_lead` is sound: in non-pixel shaders, `waveReadLaneFirst(n)` + `waveIsFirstLane()` lets one active lane handle the common bit while any lane with `n != f` still 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).
kotekompotek commented 2026-11-26 02:24:10 +00:00 (Migrated from github.com)

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.

<!-- greyfinch-sync:Marvisak/VIctory:review:6067730546 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#pullrequestreview-6067730546). Originally posted by [kotekompotek](https://github.com/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.
steven-seagull27 commented 2026-11-26 03:05:14 +00:00 (Migrated from github.com)

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.

Adapter Compute groups with correct stores and page bits Pixel draws with correct color, atomic count and page bit
RTX 5080 9/9 5/5
Windows built-in WARP 9/9 5/5
Microsoft.Warp 1.0.22 9/9 5/5

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:

git fetch https://github.com/steven-seagull27/VIctory.git codex/pr2958-mixed-marks
git cherry-pick ead53d4 dc84e33
cargo test -p victory-shader --lib divergent_view_writes_mark_each_page_in_partial_groups -- --nocapture
cargo test -p victory-shader --lib partially_covered_quads_mark_their_pixel_store -- --nocapture

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, using WaveReadLaneFirst and WaveIsFirstLane. I checked the emitted pixel DXIL: helpers bypass the election, provide false at 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:

git fetch https://github.com/steven-seagull27/VIctory.git codex/pr2958-pixel-real-mark
git cherry-pick 3c30d80
<!-- greyfinch-sync:Marvisak/VIctory:comment:7180876247 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#issuecomment-7180876247). Originally posted by [steven-seagull27](https://github.com/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. | Adapter | Compute groups with correct stores and page bits | Pixel draws with correct color, atomic count and page bit | |---|---:|---:| | RTX 5080 | 9/9 | 5/5 | | Windows built-in WARP | 9/9 | 5/5 | | Microsoft.Warp 1.0.22 | 9/9 | 5/5 | **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](https://github.com/steven-seagull27/VIctory/commit/ead53d4eaee103b33597e27b94b8334b2200ed7c) and [pixel regression dc84e33](https://github.com/steven-seagull27/VIctory/commit/dc84e33c56026e0ac9173455068d26ca3ebe7afb). The second commit adds test-host readback for graphics UAVs. To run both from this PR head: ```sh git fetch https://github.com/steven-seagull27/VIctory.git codex/pr2958-mixed-marks git cherry-pick ead53d4 dc84e33 cargo test -p victory-shader --lib divergent_view_writes_mark_each_page_in_partial_groups -- --nocapture cargo test -p victory-shader --lib partially_covered_quads_mark_their_pixel_store -- --nocapture ``` 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](https://github.com/steven-seagull27/VIctory/commit/3c30d800e43b7f31dabb3a2a1ad91c93ae239715) elects the pixel leader inside `!isHelperLane`, using `WaveReadLaneFirst` and `WaveIsFirstLane`. I checked the emitted pixel DXIL: helpers bypass the election, provide `false` at 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: ```sh git fetch https://github.com/steven-seagull27/VIctory.git codex/pr2958-pixel-real-mark git cherry-pick 3c30d80 ```
moe-miau commented 2026-11-26 05:04:10 +00:00 (Migrated from github.com)

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, and waveReadLaneAt reads 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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7182595836 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#issuecomment-7182595836). Originally posted by [moe-miau](https://github.com/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, and `waveReadLaneAt` reads 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.
Marvisak commented 2026-11-26 06:03:42 +00:00 (Migrated from github.com)

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_write and Lower::mark_view_read, the bitmap load and atomic now sit behind mark_lead (new emit/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 keyed waveActiveOp minimum. 1f9c4b3 fixes the all-helper case, so the read-lane index always names a real lane. Keeping it in a submodule keeps lower.rs under 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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7183520037 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#issuecomment-7183520037). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-26T05:28:40Z. --- <!-- victory-triage v1 head=1f9c4b3771cec8a429bf9a8dd26bfc525c224b05 verdict=merge-candidate at=2026-11-26T05:28:29Z --> Automated triage for the maintainers. This cuts down write- and read-mark traffic to the system-memory bitmap. In `Lower::mark_view_write` and `Lower::mark_view_read`, the bitmap load and atomic now sit behind `mark_lead` (new `emit/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 keyed `waveActiveOp` minimum. `1f9c4b3` fixes the all-helper case, so the read-lane index always names a real lane. Keeping it in a submodule keeps `lower.rs` under 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](https://claude.ai/code)_
walterwallaceson commented 2026-11-26 06:03:50 +00:00 (Migrated from github.com)

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). main 63bcca4 + #463 (Agility runtime, needed on Windows 10) + #2626, then + this PR at 1f9c4b3. 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:

fps ms/frame on the GPU preparing copies (ms / MB / throughput) copying back (ms / MB)
without this PR, run 1 1.79 562 364 134 46 / 104 / 2.3 GB/s 62 / 0.0
without this PR, run 2 1.73 582 383 138 41 / 111 / 2.7 GB/s 59 / 0.0
with this PR, run 1 0.60 1,697 293 456 215 / 108 / 0.5 GB/s 691 / 0.2
with this PR, run 2 0.74 1,376 261 487 225 / 99 / 0.44 GB/s 470 / 0.1
with this PR + #2705 (7dcc595, VICTORY_CARD_COPIES=1) 0.84 1,225 211 533 167 / – 357 / –

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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7183882982 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#issuecomment-7183882982). Originally posted by [walterwallaceson](https://github.com/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). `main` `63bcca4` + #463 (Agility runtime, needed on Windows 10) + #2626, then + this PR at `1f9c4b3`. 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: | | fps | ms/frame | on the GPU | preparing | copies (ms / MB / throughput) | copying back (ms / MB) | |---|---|---|---|---|---|---| | without this PR, run 1 | 1.79 | 562 | 364 | 134 | 46 / 104 / 2.3 GB/s | 62 / 0.0 | | without this PR, run 2 | 1.73 | 582 | 383 | 138 | 41 / 111 / 2.7 GB/s | 59 / 0.0 | | with this PR, run 1 | 0.60 | 1,697 | 293 | 456 | 215 / 108 / 0.5 GB/s | 691 / 0.2 | | with this PR, run 2 | 0.74 | 1,376 | 261 | 487 | 225 / 99 / 0.44 GB/s | 470 / 0.1 | | with this PR + #2705 (`7dcc595`, `VICTORY_CARD_COPIES=1`) | 0.84 | 1,225 | 211 | 533 | 167 / – | 357 / – | 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.
walterwallaceson commented 2026-11-26 07:01:49 +00:00 (Migrated from github.com)

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" (main 63bcca4 + #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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7184335309 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#issuecomment-7184335309). Originally posted by [walterwallaceson](https://github.com/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" (`main` `63bcca4` + #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.
MeMako commented 2026-11-26 07:01:57 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MeMako on 2026-11-26T07:00:43Z.


Verified #2958 (1f9c4b3) on AMD RDNA 4 (Windows 11 10.0.26200, Ryzen 9 7950X, RX 9070 XT, driver 32.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, and heap_direct_texture_reads_mark_their_heap_index).
  • Translated all 25,985 shaders cleanly via victory translate --cache (0 crashes / 0 regressions).

Live Title Verification (RX 9070 XT)

  • Setup: Local integration branch (main 63bcca4 + #2051 + #2472 + #2918 + #1010 + #2130 with VRAM upload flags off + #3055 + #2914 + #2985 + #2849 + #3035), before vs. after merging #2958 (n=65 world / n=53 heavy frames vs. n=54 / n=38 baseline).
  • Result: 0 crashes, 0 device removals, 0 visual regressions through the intro and opening world scene.
  • GPU time:
    • Heavy frames (>=4k draws): median 166.9 → 162.2 ms, avg 194.7 → 169.9 ms (-24.8 ms on streaming spikes)
    • Steady tail (last 20 heavy, ~6,056 vs. 6,186 draws): median 162.5 → 158.4 ms (-4.1 ms), avg 162.3 → 159.9 ms
  • Cross-vendor note: Unlike NVIDIA (290 → 151 ms on 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 ms avg) and zero regressions.

Hardware runs were performed by me on my 7950X / RX 9070 XT; comment drafted with Antigravity.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7185003944 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#issuecomment-7185003944). Originally posted by [MeMako](https://github.com/MeMako) on 2026-11-26T07:00:43Z. --- Verified `#2958` (`1f9c4b3`) on AMD RDNA 4 (Windows 11 `10.0.26200`, Ryzen 9 7950X, RX 9070 XT, driver `32.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`, and `heap_direct_texture_reads_mark_their_heap_index`). - Translated all **25,985** shaders cleanly via `victory translate --cache` (0 crashes / 0 regressions). ### Live Title Verification (RX 9070 XT) - **Setup:** Local integration branch (`main` `63bcca4` + `#2051` + `#2472` + `#2918` + `#1010` + `#2130` with VRAM upload flags off + `#3055` + `#2914` + `#2985` + `#2849` + `#3035`), before vs. after merging `#2958` (`n=65` world / `n=53` heavy frames vs. `n=54` / `n=38` baseline). - **Result:** 0 crashes, 0 device removals, 0 visual regressions through the intro and opening world scene. - **GPU time:** - Heavy frames (`>=4k` draws): median **166.9 → 162.2 ms**, avg **194.7 → 169.9 ms** (**-24.8 ms** on streaming spikes) - Steady tail (last 20 heavy, ~6,056 vs. 6,186 draws): median **162.5 → 158.4 ms** (**-4.1 ms**), avg **162.3 → 159.9 ms** - **Cross-vendor note:** Unlike NVIDIA (`290 → 151 ms` on 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 ms` avg) and zero regressions. *Hardware runs were performed by me on my 7950X / RX 9070 XT; comment drafted with Antigravity.*
neonbyte1 commented 2026-11-26 16:58:33 +00:00 (Migrated from github.com)

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:

  • Build: main plus 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. diag build.
  • Untimed runs: 10 minutes, medians over the last 30 frame-rate lines, warm caches.
  • Timed runs: with VICTORY_GPU_TIMING=1 VICTORY_D3D12_DRED=1, giving per-command GPU time.

Untimed (what a player would see):

without this PR with this PR
ms/frame 871.3 (1.1 fps) 672.9 (1.5 fps)
on the GPU 755.3 459.1
preparing / copying back 67.3 / 47.6 62.1 / 44.3

That's 23% less frame time. No device removal, Xid or refused pipeline in either run, and the yard renders the same.

Timed:

marks per lane this PR
GPU command time per frame 579 ms 346 ms
[mesh b7a81f5b96f4ca93, pixel 43e24028d4a1faef] (G-buffer, 151 draws/frame) 49.7 ms 8.3 ms
CS_ResetTilesMask (a7eeed0646be1ab7) top-25 entry 3.4 ms

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_pages and 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 to main + 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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7198330874 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#issuecomment-7198330874). Originally posted by [neonbyte1](https://github.com/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:** - **Build:** `main` plus 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. `diag` build. - **Untimed runs:** 10 minutes, medians over the last 30 frame-rate lines, warm caches. - **Timed runs:** with `VICTORY_GPU_TIMING=1 VICTORY_D3D12_DRED=1`, giving per-command GPU time. **Untimed** (what a player would see): | | without this PR | with this PR | |---|---|---| | ms/frame | 871.3 (1.1 fps) | **672.9 (1.5 fps)** | | on the GPU | 755.3 | **459.1** | | preparing / copying back | 67.3 / 47.6 | 62.1 / 44.3 | That's 23% less frame time. No device removal, Xid or refused pipeline in either run, and the yard renders the same. **Timed:** | | marks per lane | this PR | |---|---|---| | GPU command time per frame | 579 ms | **346 ms** | | `[mesh b7a81f5b96f4ca93, pixel 43e24028d4a1faef]` (G-buffer, 151 draws/frame) | 49.7 ms | **8.3 ms** | | `CS_ResetTilesMask` (`a7eeed0646be1ab7`) | top-25 entry | 3.4 ms | **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_pages` and 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 to `main` + 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._
neonbyte1 commented 2026-11-26 17:02:02 +00:00 (Migrated from github.com)

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:

  • Branch: neonbyte1/VIctory test/2958-bitmap, one test-only commit 1fee6b7 on top of your 1f9c4b3. Feel free to cherry-pick it.
  • What it does: wave_coalesced_marks_equal_per_lane_marks_on_the_gpu lowers the same program twice, once as is and once with the leader election disabled through a #[cfg(test)] hook in lower::marks, and compares the written bitmaps word for word.
    • It covers a 64-lane wave32 dispatch with lanes on the same and on different words, divergent branches, and bits 5, 11 and 320 already set before the dispatch.
    • Root::UavData is a small addition to the test host that presets a root UAV.
  • Result: passes on an RTX 5090 under Wine with vkd3d-proton, along with your two marks tests. Clippy (default and --all-features), policy and formatting are clean.

AI-assisted (Claude); measured on my machine, no game data shared.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7198403694 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#issuecomment-7198403694). Originally posted by [neonbyte1](https://github.com/neonbyte1) on 2026-11-26T17:02:02Z. --- The GPU test I mentioned now builds on `main` + this PR alone: - **Branch:** [neonbyte1/VIctory `test/2958-bitmap`](https://github.com/neonbyte1/VIctory/commits/test/2958-bitmap), one test-only commit `1fee6b7` on top of your `1f9c4b3`. Feel free to cherry-pick it. - **What it does:** `wave_coalesced_marks_equal_per_lane_marks_on_the_gpu` lowers the same program twice, once as is and once with the leader election disabled through a `#[cfg(test)]` hook in `lower::marks`, and compares the written bitmaps word for word. - It covers a 64-lane wave32 dispatch with lanes on the same and on different words, divergent branches, and bits 5, 11 and 320 already set before the dispatch. - `Root::UavData` is a small addition to the test host that presets a root UAV. - **Result:** passes on an RTX 5090 under Wine with vkd3d-proton, along with your two marks tests. Clippy (default and `--all-features`), policy and formatting are clean. _AI-assisted (Claude); measured on my machine, no game data shared._
moe-miau commented 2026-11-27 02:36:23 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by moe-miau on 2026-11-27T02:36:23Z.


@neonbyte1 thanks, I took 1fee6b7 as is, with your authorship kept. wave_coalesced_marks_equal_per_lane_marks_on_the_gpu passes here on an RTX 4070 SUPER (Windows, native D3D12) too. Policy is clean.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7208276521 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#issuecomment-7208276521). Originally posted by [moe-miau](https://github.com/moe-miau) on 2026-11-27T02:36:23Z. --- @neonbyte1 thanks, I took `1fee6b7` as is, with your authorship kept. `wave_coalesced_marks_equal_per_lane_marks_on_the_gpu` passes here on an RTX 4070 SUPER (Windows, native D3D12) too. Policy is clean.
borosf commented 2026-11-27 09:03:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-27T09:03:19Z.


Intel Arc B580 (Battlemage), Windows 11: CS_ResetTilesMask goes 1,866 → 57 ms a frame, frame 4,734 → 1,299 ms

No 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, diag build, caches warm for both runs, 230 s each. main is 63bcca4; the PR's
three commits (4f99be41) are applied on top as a patch — the branch shares no history with main, so
git diff 4f99be41~3 4f99be41 was applied with git 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=1 and VICTORY_D3D12_DRED=1. HostList::note is gated on dred_on()
(host.rs:2009), so with timing alone the report prints lists 3959.2 ms/frame of wall time, their commands 0.0 ms/frame and 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:

main 63bcca4 + this PR
ms/frame 4734.3 1298.8
on the GPU 4158.7 759.6
their commands 3949.9 764.8
dispatch [compute a7eeed0646be1ab7] = CS_ResetTilesMask, 1 command/frame 1866.2 56.8
draws/frame 2582 2310

That dispatch is 45% of the whole frame on main here, and 33x cheaper with the PR — the largest share of any
report 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 main is the same finding from the list side.

The dispatch is 23400x1x1 in both runs, same hash, same count, so the comparison is the same work; the
draws/frame differ by 11% because the two runs catch the intro at slightly different points, so read the
frame-level rows as ±10% and the CS_ResetTilesMask row as the solid one.

cargo test -p victory-shader --lib wave_coalesced_marks_equal_per_lane_marks_on_the_gpu -- --test-threads=1
passes 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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7214226782 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#issuecomment-7214226782). Originally posted by [borosf](https://github.com/borosf) on 2026-11-27T09:03:19Z. --- **Intel Arc B580 (Battlemage), Windows 11: `CS_ResetTilesMask` goes 1,866 → 57 ms a frame, frame 4,734 → 1,299 ms** No 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`, `diag` build, caches warm for both runs, 230 s each. `main` is `63bcca4`; the PR's three commits (`4f99be41`) are applied on top as a patch — the branch shares no history with `main`, so `git diff 4f99be41~3 4f99be41` was applied with `git 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=1` **and** `VICTORY_D3D12_DRED=1`. `HostList::note` is gated on `dred_on()` (`host.rs:2009`), so with timing alone the report prints `lists 3959.2 ms/frame of wall time, their commands 0.0 ms/frame` and 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:** | | `main` `63bcca4` | + this PR | |---|---:|---:| | ms/frame | 4734.3 | **1298.8** | | on the GPU | 4158.7 | **759.6** | | their commands | 3949.9 | **764.8** | | `dispatch [compute a7eeed0646be1ab7]` = `CS_ResetTilesMask`, 1 command/frame | **1866.2** | **56.8** | | draws/frame | 2582 | 2310 | That dispatch is 45% of the whole frame on `main` here, and 33x cheaper with the PR — the largest share of any report 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 `main` is the same finding from the list side. The dispatch is `23400x1x1` in both runs, same hash, same count, so the comparison is the same work; the `draws/frame` differ by 11% because the two runs catch the intro at slightly different points, so read the frame-level rows as ±10% and the `CS_ResetTilesMask` row as the solid one. `cargo test -p victory-shader --lib wave_coalesced_marks_equal_per_lane_marks_on_the_gpu -- --test-threads=1` passes 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.
borosf commented 2026-11-27 09:20:09 +00:00 (Migrated from github.com)

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:

  • main 63bcca4: 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 in
    the 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
main reaching world frame +128 would take about ten minutes rather than two and a half. What I can say is
that across the wall-clock windows I have watched and captured (about four minutes each), main stayed a
pink 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 failed and memory allocation of 1048576 bytes failed two to four
minutes into the world, on a 32 GB machine with the working set around 19 GB. main never showed it here, but
my main runs are killed at 230-260 s by their own timeout, so I am not blaming the PR — just flagging that
the 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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7214558233 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#issuecomment-7214558233). Originally posted by [borosf](https://github.com/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: - `main` `63bcca4`: 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 in the 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 `main` reaching world frame +128 would take about ten minutes rather than two and a half. What I can say is that across the wall-clock windows I have watched and captured (about four minutes each), `main` stayed a pink 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 failed` and `memory allocation of 1048576 bytes failed` two to four minutes into the world, on a 32 GB machine with the working set around 19 GB. `main` never showed it here, but my `main` runs are killed at 230-260 s by their own timeout, so I am not blaming the PR — just flagging that the 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.
borosf commented 2026-11-27 10:26:29 +00:00 (Migrated from github.com)

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 presented

I 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, diag build, VICTORY_GPU_TIMING=1 VICTORY_D3D12_DRED=1, 110 s each.

tree runs device removals frames presented, total
main 63bcca4 alone 4 0 8901
main + this PR (4f99be41) 4 3 7532
main + this PR + #3312 2 1 3368

The frame column is the point: the patched builds presented fewer frames in those windows than main did, and
still faulted, so this is not simply more work getting more chances to fail.

Signature, identical in all four faults:

ERROR victory_gpu::host: host GPU device removed after a submission of 11 lists; page fault at 0x800019bdf000;
      no title memory copy below it; the nearest above: …
  • four different addresses, and every one ends in f000: 0x800019bdf000, 0x80002507f000, 0x80000d7cf000,
    0x800001dff000 — the same 4 KiB page inside a 64 KiB block each time
  • always before the world is reached, after 11-34 lists in the submission
  • the same build also completed a 230 s run clean earlier on the old driver, so it is intermittent, not every run
  • nothing points at a title memory copy, and I checked the fault address against the VRAM twins in #3312: those
    land at 0xffffb802…, so this is not an over-read of one of those

What 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 (2b48889a vs 1f9c4b37), run
this 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_ResetTilesMask 1866.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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7215888358 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#issuecomment-7215888358). Originally posted by [borosf](https://github.com/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 presented** I 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`, `diag` build, `VICTORY_GPU_TIMING=1 VICTORY_D3D12_DRED=1`, 110 s each. | tree | runs | device removals | frames presented, total | |---|---:|---:|---:| | `main` `63bcca4` alone | 4 | **0** | 8901 | | `main` + this PR (`4f99be41`) | 4 | **3** | 7532 | | `main` + this PR + #3312 | 2 | 1 | 3368 | The frame column is the point: the patched builds presented *fewer* frames in those windows than `main` did, and still faulted, so this is not simply more work getting more chances to fail. **Signature, identical in all four faults:** ``` ERROR victory_gpu::host: host GPU device removed after a submission of 11 lists; page fault at 0x800019bdf000; no title memory copy below it; the nearest above: … ``` - four different addresses, and **every one ends in `f000`**: `0x800019bdf000`, `0x80002507f000`, `0x80000d7cf000`, `0x800001dff000` — the same 4 KiB page inside a 64 KiB block each time - always before the world is reached, after 11-34 lists in the submission - the same build also completed a 230 s run clean earlier on the old driver, so it is intermittent, not every run - nothing points at a title memory copy, and I checked the fault address against the VRAM twins in #3312: those land at `0xffffb802…`, so this is not an over-read of one of those **What 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 (`2b48889a` vs `1f9c4b37`), run this 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_ResetTilesMask` 1866.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.
borosf commented 2026-11-27 10:43:27 +00:00 (Migrated from github.com)

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, with VICTORY_D3D12_DRED=1 and before the world: same signature, a page fault in 0x8000… 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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7216227881 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#issuecomment-7216227881). Originally posted by [borosf](https://github.com/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, with `VICTORY_D3D12_DRED=1` and before the world: same signature, a page fault in `0x8000…` 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.
moe-miau commented 2026-11-27 11:16:15 +00:00 (Migrated from github.com)

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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7216879141 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#issuecomment-7216879141). Originally posted by [moe-miau](https://github.com/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.
borosf commented 2026-11-27 11:25:08 +00:00 (Migrated from github.com)

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 16x1x1 compute 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 || first keeps 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, and waveActiveOp only ever elects an active lane, so waveReadLaneAt never targets an exited one. The bit-for-bit test against the per-lane path is the right guard for this.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7217050350 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#issuecomment-7217050350). Originally posted by [borosf](https://github.com/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 `16x1x1` compute 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 || first` keeps 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, and `waveActiveOp` only ever elects an active lane, so `waveReadLaneAt` never targets an exited one. The bit-for-bit test against the per-lane path is the right guard for this.
Desamodeth commented 2026-11-27 12:44:03 +00:00 (Migrated from github.com)

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.

Pair (control → PR) Median p95 FPS over the intervals
First, PR ran first 590 → 491 ms 1,122 → 882 ms 1.64 → 2.00
Second, control ran first 613 → 566 ms 1,210 → 1,068 ms 1.50 → 1.74

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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7218608406 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#issuecomment-7218608406). Originally posted by [Desamodeth](https://github.com/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. | Pair (control → PR) | Median | p95 | FPS over the intervals | |---|---:|---:|---:| | First, PR ran first | 590 → 491 ms | 1,122 → 882 ms | 1.64 → 2.00 | | Second, control ran first | 613 → 566 ms | 1,210 → 1,068 ms | 1.50 → 1.74 | 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.
rpmaster2 commented 2026-11-27 18:16:30 +00:00 (Migrated from github.com)

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

0xc0000005 in the host binary, read of 0x30, no Rust panic message before it:

FAULT: VIctory: unhandled exception 0xc0000005 at victory-up2958.exe+0x247303 (read 0x30: nothing mapped there)

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, a shader 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

GPU Radeon RX 9070 XT 16 GB (RDNA4), Adrenalin 26.11.2, driver 32.0.32029.2010
CPU / RAM Ryzen 5 5600, 32 GB DDR4-3600, page file 32-48 GB
OS Windows 11 10.0.26100.9974
Build this PR, 4f99be4, cargo build --locked --profile diag -p victory --features diagnostics (25.6 s)
Settings --console series-x, VICTORY_PRESENT_TARGET=1x1:1, scripted keys, same dump and save for every run
Caches shader and pipeline caches warm, driver cache emptied before the pair

Run 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

main 63bcca4, 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 on main; 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 main this 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 0x30 from 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 is crates/victory-shader/src/emit/lower/marks.rs (the leader election for wave marks) plus small changes in emit/host.rs and emit/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/addr2line are not installed), so +0x247303 is 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 = 2 for the whole workspace (or panic = "abort" off) and get a stack from the crash reporter, or add a debug_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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7225316726 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2958#issuecomment-7225316726). Originally posted by [rpmaster2](https://github.com/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 `0xc0000005` in the host binary, read of `0x30`, no Rust panic message before it: ``` FAULT: VIctory: unhandled exception 0xc0000005 at victory-up2958.exe+0x247303 (read 0x30: nothing mapped there) ``` 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`, a `shader 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 | | | |---|---| | GPU | Radeon RX 9070 XT 16 GB (RDNA4), Adrenalin 26.11.2, driver 32.0.32029.2010 | | CPU / RAM | Ryzen 5 5600, 32 GB DDR4-3600, page file 32-48 GB | | OS | Windows 11 10.0.26100.9974 | | Build | this PR, `4f99be4`, `cargo build --locked --profile diag -p victory --features diagnostics` (25.6 s) | | Settings | `--console series-x`, `VICTORY_PRESENT_TARGET=1x1:1`, scripted keys, same dump and save for every run | | Caches | shader and pipeline caches warm, driver cache emptied before the pair | Run 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 `main` `63bcca4`, 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 on `main`; 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 `main` this 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 `0x30` from 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 is `crates/victory-shader/src/emit/lower/marks.rs` (the leader election for wave marks) plus small changes in `emit/host.rs` and `emit/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`/`addr2line` are not installed), so `+0x247303` is 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 = 2` for the whole workspace (or `panic = "abort"` off) and get a stack from the crash reporter, or add a `debug_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.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2958:upstream-pr/2958'
git switch 'upstream-pr/2958'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/2958'
git switch 'upstream-pr/2958'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2958'
git switch 'upstream-pr/2958'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2958'
git switch 'main'
git merge --squash 'upstream-pr/2958'
git switch 'main'
git merge --ff-only 'upstream-pr/2958'
git switch 'main'
git merge 'upstream-pr/2958'
git push origin 'main'
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
Marvisak/VIctory!2956
No description provided.