shader: a wave64 mesh program's first-lane read is its console wave's (#517) #518
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/518"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by alexballvideos-netizen on 2026-11-27T23:47:33Z.
Refs #517, #258
The G-buffer mesh programs are wave64 groups whose threads are console lanes, so each 32-lane host wave is half a console wave. Their
v_readfirstlane_b32lowered towaveReadLaneFirst, so lanes 32 to 63 read lane 32's value instead of lane 0's and built their vertices and primitives from the wrong meshlet. That's the fans and sheets in the G-buffer.What this changes
mesh_first_lane(halves.rs): each host wave finds its own first active lane (host_ballot+FirstbitLo+waveReadLaneAt). Its lane 0 stores the value and its lane 1 whether any lane was on, in group-shared memory. After a group barrier, every thread takes the lower half's value if it had a lane on, else the upper half's. This is the same exchange #302 proposes for compute.once_blocks), so both halves always reach the barriers. Elsewhere the read stays per host wave, as before.Checks
export_tests::a_wave64_mesh_programs_first_lane_read_is_its_console_waves: it fails without the fix and passes with it. Allvictory-shadertests pass (403 + 5).x86_64-pc-windows-gnullvm,-D warnings) andcargo xtask policypass.main(21,579 shaders): no shader is newly refused or newly translated. The output of 6,959 vertex (mesh) programs changes, which is expected since they're the ones with the instruction.b3c1a1b0,VICTORY_GUESS_GRAPHICS=1 VICTORY_DEPTH_TWINS=0): G-buffer dumps every 20 s from 140 to 290 s show clean characters, cars and buildings, where every earlier run had fans. There were no GPU timeouts, and the run ended at the sameimage+0x55e56f8exception as the baselines.docs/native-host.mdhas a new section on this.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by alexballvideos-netizen on 2026-11-28T00:39:18Z.
Rechecked on
main(86cefd22, which now has the preview's graphics fixes). M3 Max 36 GB, Series X, headless,VICTORY_DEPTH_TWINS=0, base-colour target dumped every 25 s from 140 s:mainmain+ this PR (b7dd2ee1)The run with the fix went the full 320 s with no GPU time-outs. The baseline's first attempt hit the usual
image+0x55e56f8exception at about 170 s, and its second attempt is the one in the table.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T01:05:13Z.
Confirmed on another Mac: thanks @alexballvideos-netizen, this fixes the shards.
M5 Pro 48 GB, Series S, windowed, 250 s a run,
VICTORY_DEPTH_TWINS=0, G-buffer base colour (DXGI 29, 1280x720) dumped every 15 s from 150 s:6c24066f)578134be)GPU memory drained to 0 GB after both runs. Left over after the fix: the sky is black in the G-buffer (expected there), and one head showed a blocky low-detail patch at one present. The two runs aren't at the same shots (the cutscene follows wall time), but every frame before is broken and every frame after is clean, so the result doesn't hang on alignment. A pair with depth twins on is running.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T01:28:06Z.
The same pair with depth twins on (the default), lit scene (DXGI 10, 1280x720), windowed, M5 Pro, Series S, 250 s:
6c24066f), 6 dumps578134be), 5 dumpsSo the "flying shards, fence panels and rays drawn into the lit scene" and the "triangles missing on characters and clothing" both came from the mesh programs' first-lane read, and this fixes them on our Mac too. What's left with twins on: dark interiors (#526) and some small rectangles of a regular dot pattern in the lit scene, not investigated yet.