First renders on an RTX 5080: world meshes reach the G-buffer (wave64 mesh lanes numbered by the host) #940

Open
opened 2026-11-26 04:14:32 +00:00 by github-bot · 7 comments
Owner

@⁠Peppacodes on GitHub · 2026-11-24 14:23 UTC · original

What renders

On an NVIDIA RTX 5080 (32-lane waves only), the world's mesh shaders now draw world geometry into the G-buffer. The presented image is still black.

From VICTORY_DUMP_TARGETS=1:

  • Frame 1550, two 2560×1440 targets (formats 28 and 87): full of hard-edged world meshes across the letterboxed view, including large surfaces, a framed structure and foliage-like clumps. The colours are packed data shown raw, so they're false colour, but the shapes are clearly geometry.
  • Frames 1500 and 1600, a 480×270 target (format 24): a tree-line skyline over open ground or water. It's identical in both frames from a fixed camera, so it's stable content, not noise.
  • Without mesh shaders (run 17), the same 2560×1440 targets are uniform.

Images stay local (rule #1). Counts, hashes and frame numbers only here.

The new change

Shaders: wave64 mesh code counts lanes the host's way on 32-lane hosts

Mesh shaders can't declare WaveSize, so on a 32-lane host a wave64 mesh program runs as two 32-lane waves:

  • Its lane masks come from host ballots, which hold no bits for console lanes 32–63.
  • lane_index() numbered mesh lanes by console lane (flattenedThreadIdInGroup & 63).
  • So v_mbcnt and lane picks on console lanes 32–63 read an empty half.

When #189's mode isn't Native, the change numbers wave64 mesh lanes by the host lane (WaveGetLaneIndex), so masks and lane numbers agree within each 32-lane half. Mesh code reads no other lanes (the existing comment there, and @⁠ByMateos's census in #778), so each half acts as a narrower console wave.

It doesn't cover the 115 programs with explicit lane reads. @⁠alfycs's feat/wave64-mesh-emulation (LDS emulation) is the fuller fix for those. This is a much smaller alternative for the rest.

Tree and settings

The tree is main ffe310e plus:

It's a diagnostics build, run with TdrDelay 60 s and the title's hang watchdog turned off. I used a local VICTORY_PATCH=2215c70:9090,2215bdc:9090; that's the same thing as #454 and #917.

Run Settings Result
16 #189, VICTORY_SKIP_WAVE64=mesh #189 picks Wave32. Pipeline-creation failures drop from 148 to 9. About 9 minutes in the world at 1 fps, 264 draws per frame, no device removal. The screen is black.
17 same, with target dumps The G-buffer is empty. Only the skyline target has content.
18 mesh allowed, this change, VICTORY_SHADER_LOOP_LIMIT=64 The G-buffer has world geometry at frame 1550. Then DXGI_ERROR_DEVICE_HUNG after a 0.55 s submission at frame 1560: in flight were mesh 97356b4fcf9fbb3f and the compute chain 2c3592e9bbad543f.

Not checked yet

  • Whether this change is what makes the geometry appear. An A/B run of the same tree without it (loop limit 64 alone) is running now; I'll add the result here.
  • Whether the fault goes away with #587 (mesh output bounds) and #452 (spin limit). That run is next.
  • Whether the geometry is correct. The targets hold packed data, so they can't be judged by eye.

No game files are attached. AI-assisted (Claude Code): the runs were made on my machine with my own copy.

**@⁠Peppacodes** on GitHub · 2026-11-24 14:23 UTC · [original](https://github.com/Marvisak/VIctory/issues/940) ### What renders On an NVIDIA RTX 5080 (32-lane waves only), the world's mesh shaders now draw world geometry into the G-buffer. The presented image is still black. From `VICTORY_DUMP_TARGETS=1`: - **Frame 1550, two 2560×1440 targets (formats 28 and 87):** full of hard-edged world meshes across the letterboxed view, including large surfaces, a framed structure and foliage-like clumps. The colours are packed data shown raw, so they're false colour, but the shapes are clearly geometry. - **Frames 1500 and 1600, a 480×270 target (format 24):** a tree-line skyline over open ground or water. It's identical in both frames from a fixed camera, so it's stable content, not noise. - **Without mesh shaders (run 17), the same 2560×1440 targets are uniform.** Images stay local (rule #1). Counts, hashes and frame numbers only here. ### The new change `Shaders: wave64 mesh code counts lanes the host's way on 32-lane hosts` - Branch: https://github.com/Peppacodes/VIctory/tree/exp/mesh-host-lanes - Commit: `ed9afc0`. It is one small change in `lane_index()` in `emit/lower.rs`, on top of #189. Mesh shaders can't declare `WaveSize`, so on a 32-lane host a wave64 mesh program runs as two 32-lane waves: - Its lane masks come from host ballots, which hold no bits for console lanes 32–63. - `lane_index()` numbered mesh lanes by console lane (`flattenedThreadIdInGroup & 63`). - So `v_mbcnt` and lane picks on console lanes 32–63 read an empty half. When #189's mode isn't `Native`, the change numbers wave64 mesh lanes by the host lane (`WaveGetLaneIndex`), so masks and lane numbers agree within each 32-lane half. Mesh code reads no other lanes (the existing comment there, and @⁠ByMateos's census in #778), so each half acts as a narrower console wave. It doesn't cover the 115 programs with explicit lane reads. @⁠alfycs's `feat/wave64-mesh-emulation` (LDS emulation) is the fuller fix for those. This is a much smaller alternative for the rest. ### Tree and settings The tree is `main` `ffe310e` plus: - #189; - #583, #694, #632 and #579; - small fork fixes for #720, #762, #764, #765 and #832; - a fence-wake change (the same idea as PR #32); - the change above. It's a diagnostics build, run with `TdrDelay` 60 s and the title's hang watchdog turned off. I used a local `VICTORY_PATCH=2215c70:9090,2215bdc:9090`; that's the same thing as #454 and #917. | Run | Settings | Result | |---|---|---| | 16 | #189, `VICTORY_SKIP_WAVE64=mesh` | #189 picks `Wave32`. Pipeline-creation failures drop from **148 to 9**. About 9 minutes in the world at 1 fps, 264 draws per frame, no device removal. The screen is black. | | 17 | same, with target dumps | The G-buffer is empty. Only the skyline target has content. | | 18 | mesh allowed, this change, `VICTORY_SHADER_LOOP_LIMIT=64` | **The G-buffer has world geometry at frame 1550.** Then `DXGI_ERROR_DEVICE_HUNG` after a 0.55 s submission at frame 1560: in flight were mesh `97356b4fcf9fbb3f` and the compute chain `2c3592e9bbad543f`. | ### Not checked yet - **Whether this change is what makes the geometry appear.** An A/B run of the same tree without it (loop limit 64 alone) is running now; I'll add the result here. - **Whether the fault goes away with #587 (mesh output bounds) and #452 (spin limit).** That run is next. - **Whether the geometry is correct.** The targets hold packed data, so they can't be judged by eye. No game files are attached. AI-assisted (Claude Code): the runs were made on my machine with my own copy.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:14:32 +00:00
Author
Owner

@⁠EduBertozzi on GitHub · 2026-11-24 14:24 UTC · original

One note for whoever carries ed9afc0 forward: the compute fallback for GPUs without mesh shaders (#3, pr/mesh-compute-fallback on my fork) lowers mesh programs through the same lane_index(). s.mesh stays set when mesh_as_compute is on, so the compute form also numbers lanes as flattenedThreadIdInGroup & 63.

On a 32-lane GPU without mesh shaders (Pascal, or Intel iGPUs before Arc running 32-wide), a wave64 mesh program run as compute therefore has the same mismatch you describe: host-ballot masks covering 32 lanes, numbered by console lane. The change should cover that path as written. Its condition is on #189's mode, not on the shader stage. If it lands, I'll add a case to the fallback's synthetic tests: a 128-thread wave64 program using v_mbcnt, run as compute on a GTX 1060.

AI-assisted (Claude Code).

**@⁠EduBertozzi** on GitHub · 2026-11-24 14:24 UTC · [original](https://github.com/Marvisak/VIctory/issues/940#issuecomment-7134315439) One note for whoever carries `ed9afc0` forward: the compute fallback for GPUs without mesh shaders (#3, `pr/mesh-compute-fallback` on my fork) lowers mesh programs through the same `lane_index()`. `s.mesh` stays set when `mesh_as_compute` is on, so the compute form also numbers lanes as `flattenedThreadIdInGroup & 63`. On a 32-lane GPU without mesh shaders (Pascal, or Intel iGPUs before Arc running 32-wide), a wave64 mesh program run as compute therefore has the same mismatch you describe: host-ballot masks covering 32 lanes, numbered by console lane. The change should cover that path as written. Its condition is on #189's mode, not on the shader stage. If it lands, I'll add a case to the fallback's synthetic tests: a 128-thread wave64 program using `v_mbcnt`, run as compute on a GTX 1060. AI-assisted (Claude Code).
Author
Owner

@⁠Peppacodes on GitHub · 2026-11-24 14:24 UTC · original

A/B result, one run each, same tree and settings (loop limit 64, mesh allowed, watchdog off). The only difference is ed9afc0:

With ed9afc0 (run 18) Without it (run 19)
First world submissions 0.29 s and 0.55 s 62.8 s: device removed (0x887A0006, TDR at 60 s)
Where it stopped frame 1560 frame 1545, the first world frame
In flight — indirect DispatchMesh (kind 10) of mesh 9e3584abcc819e6c, pixel b8df138593588098, list 9 at command 274
G-buffer at frame 1550 world geometry not reached

So with a loop limit of 64 alone, 9e3584abcc819e6c still runs past a minute on this card. With the host-lane numbering, the world frames finish in well under a second and the meshes reach the G-buffer.

The run with the change still ends in a fault (DEVICE_HUNG after a 0.55 s submission, not a timeout) at frame 1560. Next run: the same, plus #587 and #452.

**@⁠Peppacodes** on GitHub · 2026-11-24 14:24 UTC · [original](https://github.com/Marvisak/VIctory/issues/940#issuecomment-7134330451) A/B result, one run each, same tree and settings (loop limit 64, mesh allowed, watchdog off). The only difference is `ed9afc0`: | | With `ed9afc0` (run 18) | Without it (run 19) | |---|---|---| | First world submissions | 0.29 s and 0.55 s | **62.8 s**: device removed (`0x887A0006`, TDR at 60 s) | | Where it stopped | frame 1560 | frame 1545, the first world frame | | In flight | — | indirect `DispatchMesh` (kind 10) of `mesh 9e3584abcc819e6c, pixel b8df138593588098`, list 9 at command 274 | | G-buffer at frame 1550 | world geometry | not reached | So with a loop limit of 64 alone, `9e3584abcc819e6c` still runs past a minute on this card. With the host-lane numbering, the world frames finish in well under a second and the meshes reach the G-buffer. The run with the change still ends in a fault (`DEVICE_HUNG` after a 0.55 s submission, not a timeout) at frame 1560. Next run: the same, plus #587 and #452.
Author
Owner

@⁠Peppacodes on GitHub · 2026-11-24 14:28 UTC · original

Run 20: the same tree plus #587 (mesh output bounds) and #452 (spin limit, its defaults, no manual loop limit). Wave64 mesh allowed, watchdog off, RTX 5080.

  • In the world past frame 1650, no device removal so far. Runs 18 and 19 died at frames 1560 and 1545.
  • Frame 1650, 2560×1440 G-buffer targets (formats 87 and 28): a much fuller view than run 18. There's a large ceiling-like plane, a bright rectangular panel in the middle, dense clutter of objects, and a structure with small coloured lights at the right. It's still packed data in false colour.
  • Frame 1650, a 2048×2048 format-53 target (a shadow map): clearly shows a character model with limbs and an object next to it, seen from the light.
  • The presented frames are still black (1600 flat, 1650 at a mean of 0.3).

New on this card, possibly relevant to the E_OUTOFMEMORY refusals reported on #233/#334: a pipeline worker thread overflowed its stack inside the driver's compiler. The trace is thread 'victory-pipelines-4' has overflowed its stack, 0xc00000fd, with nvgpucomp64.dll+0x254c175 and +0x254c362 repeating. That was followed by host pipeline refused … 0x8007000E for compute c7d7a6283fad3cd6. The driver here is 32.0.16.1692. The workers use Rust's default 2 MB stack (pipeline/make.rs); I'll try a bigger one next and report whether that program then gets a pipeline.

**@⁠Peppacodes** on GitHub · 2026-11-24 14:28 UTC · [original](https://github.com/Marvisak/VIctory/issues/940#issuecomment-7134431675) Run 20: the same tree plus #587 (mesh output bounds) and #452 (spin limit, its defaults, no manual loop limit). Wave64 mesh allowed, watchdog off, RTX 5080. - **In the world past frame 1650, no device removal so far.** Runs 18 and 19 died at frames 1560 and 1545. - **Frame 1650, 2560×1440 G-buffer targets (formats 87 and 28):** a much fuller view than run 18. There's a large ceiling-like plane, a bright rectangular panel in the middle, dense clutter of objects, and a structure with small coloured lights at the right. It's still packed data in false colour. - **Frame 1650, a 2048×2048 format-53 target (a shadow map):** clearly shows a **character model with limbs** and an object next to it, seen from the light. - **The presented frames are still black** (1600 flat, 1650 at a mean of 0.3). New on this card, possibly relevant to the `E_OUTOFMEMORY` refusals reported on #233/#334: a pipeline worker thread overflowed its stack inside the driver's compiler. The trace is `thread 'victory-pipelines-4' has overflowed its stack`, `0xc00000fd`, with `nvgpucomp64.dll+0x254c175` and `+0x254c362` repeating. That was followed by `host pipeline refused … 0x8007000E` for compute `c7d7a6283fad3cd6`. The driver here is 32.0.16.1692. The workers use Rust's default 2 MB stack (`pipeline/make.rs`); I'll try a bigger one next and report whether that program then gets a pipeline.
Author
Owner

@⁠Peppacodes on GitHub · 2026-11-24 14:29 UTC · original

Correction to the run 20 note above: the device was removed at frame 1653, about a minute before I posted it. The cause was a 63.3 s submission (0x887A0006, TDR at 60 s), with DispatchMesh of mesh 51ff151f75cd5759, pixel 7fe75645c406cac6 (list 1, command 501 of 546) and mesh 2a3ee88be3ae34a4 in flight. The four world submissions before it took 0.3–0.86 s. So #452's spin limit doesn't bound that loop. Next: the same tree with @⁠KenzoPortela's loop budget, which kept an RTX 3070 in the world for 30 minutes.

**@⁠Peppacodes** on GitHub · 2026-11-24 14:29 UTC · [original](https://github.com/Marvisak/VIctory/issues/940#issuecomment-7134458467) Correction to the run 20 note above: the device was removed at frame 1653, about a minute before I posted it. The cause was a **63.3 s submission** (`0x887A0006`, TDR at 60 s), with `DispatchMesh` of `mesh 51ff151f75cd5759, pixel 7fe75645c406cac6` (list 1, command 501 of 546) and `mesh 2a3ee88be3ae34a4` in flight. The four world submissions before it took 0.3–0.86 s. So #452's spin limit doesn't bound that loop. Next: the same tree with @⁠KenzoPortela's loop budget, which kept an RTX 3070 in the world for 30 minutes.
Author
Owner

@⁠bailu12300 on GitHub · 2026-11-24 14:37 UTC · original

Ported ed9afc0 to an RTX 5060 tree — the world still presents black

Tried your mesh-host-lane change on a minimal local tree (upstream ffe310e + #876 typeless + #902 heap fallback + the #728 waterfall/lane fork). That tree has no Wave64Mode / host_lane_index() (no #189), so I reproduced the semantics inline in lane_index():

if self.s.mesh.is_some() {
    if self.x.native.wave64 {
        self.s.flags |= flags::WAVE_OPS;
        return self.s.op(self.s.entry, "waveGetLaneIndex", Attr::ReadOnly, self.s.t.i32, 111, &[]);
    }
    ...
}

Compiles clean, runs through the same boot path. Result: presented image unchanged — 500 draws/frame, 1.0 fps (1080 ms/frame), uniform dark purple, same as before the patch. No device removal, no no host texture, heap still capped at 1,000,000 for 1,245,184.

So on my machine the mesh lane numbering isn't what gated the picture: the scene has been reaching the title's targets (per your dump and #841's) all along, and the swapchain side stays zero. Two independent confirmations now (your 5080 G-buffer content, #841's 3090 2560×1440 non-zero / 3840×2160 zero) point at the present/copy path rather than mesh lane reads.

If it helps: VICTORY_DUMP_TARGETS on this tree crashes after ~1 min with 0x80000003 at victory-image…+0x1e1d3c8, so I couldn't get my own pixel stats — the copy-path comparison needs a tree where the dump survives.

**@⁠bailu12300** on GitHub · 2026-11-24 14:37 UTC · [original](https://github.com/Marvisak/VIctory/issues/940#issuecomment-7134691768) ## Ported `ed9afc0` to an RTX 5060 tree — the world still presents black Tried your mesh-host-lane change on a minimal local tree (upstream `ffe310e` + #876 typeless + #902 heap fallback + the `#728` waterfall/lane fork). That tree has no `Wave64Mode` / `host_lane_index()` (no #189), so I reproduced the semantics inline in `lane_index()`: ```rust if self.s.mesh.is_some() { if self.x.native.wave64 { self.s.flags |= flags::WAVE_OPS; return self.s.op(self.s.entry, "waveGetLaneIndex", Attr::ReadOnly, self.s.t.i32, 111, &[]); } ... } ``` Compiles clean, runs through the same boot path. **Result: presented image unchanged** — `500 draws/frame`, 1.0 fps (1080 ms/frame), uniform dark purple, same as before the patch. No device removal, no `no host texture`, heap still capped at 1,000,000 for 1,245,184. So on my machine the mesh lane numbering isn't what gated the picture: the scene has been reaching the title's targets (per your dump and #841's) all along, and the swapchain side stays zero. Two independent confirmations now (your 5080 G-buffer content, #841's 3090 2560×1440 non-zero / 3840×2160 zero) point at the present/copy path rather than mesh lane reads. If it helps: `VICTORY_DUMP_TARGETS` on this tree crashes after ~1 min with `0x80000003 at victory-image…+0x1e1d3c8`, so I couldn't get my own pixel stats — the copy-path comparison needs a tree where the dump survives.
Author
Owner

@⁠Peppacodes on GitHub · 2026-11-24 14:52 UTC · original

Update from the same RTX 5080: with mpDom's pr/present-1440p-fallback (d6897fa, which is r4tedx's integration stack plus VICTORY_PRESENT_1440P), the world is on screen. It's a street scene in false colour, at 3,000–3,800 draws per frame. Details, plus a save-file pitfall for scripted runs, are in #841.

**@⁠Peppacodes** on GitHub · 2026-11-24 14:52 UTC · [original](https://github.com/Marvisak/VIctory/issues/940#issuecomment-7135088078) Update from the same RTX 5080: with mpDom's `pr/present-1440p-fallback` (`d6897fa`, which is r4tedx's integration stack plus `VICTORY_PRESENT_1440P`), **the world is on screen**. It's a street scene in false colour, at 3,000–3,800 draws per frame. Details, plus a save-file pitfall for scripted runs, are in #841.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 06:57 UTC · original

Automated triage for the maintainers.

Thanks for the A/B runs on the RTX 5080. On main, lane_index in crates/victory-shader/src/emit/lower.rs still numbers mesh lanes by console lane (mesh_thread() & (wave - 1)), so the change in ed9afc0 (host lane numbering for wave64 mesh code on 32-lane hosts) isn't there. No open pull request carries it, and it is stacked on #189. Pull requests are open to everyone again, so please open one once #189's mode switch is settled. Note the comment above: the compute fallback in PR #961 goes through the same lane_index.

Wave64 mesh programs on 32-lane hosts are discussed in #778, and the NVIDIA world hang is tracked in #71. The later device removals in these runs were long DispatchMesh submissions with this change applied, so the change doesn't end the hang on its own. Left for the maintainers.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 06:57 UTC · [original](https://github.com/Marvisak/VIctory/issues/940#issuecomment-7155331695) <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-24T14:52:24Z at=2026-11-25T06:57:16Z --> Automated triage for the maintainers. Thanks for the A/B runs on the RTX 5080. On `main`, `lane_index` in `crates/victory-shader/src/emit/lower.rs` still numbers mesh lanes by console lane (`mesh_thread() & (wave - 1)`), so the change in `ed9afc0` (host lane numbering for wave64 mesh code on 32-lane hosts) isn't there. No open pull request carries it, and it is stacked on #189. Pull requests are open to everyone again, so please open one once #189's mode switch is settled. Note the comment above: the compute fallback in PR #961 goes through the same `lane_index`. Wave64 mesh programs on 32-lane hosts are discussed in #778, and the NVIDIA world hang is tracked in #71. The later device removals in these runs were long `DispatchMesh` submissions with this change applied, so the change doesn't end the hang on its own. Left for the maintainers. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#940
No description provided.