World renders black: the lighting compute and the upscale are refused, and the G-buffer is mostly empty #182
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 LakshanSivakumar on 2026-11-26T23:15:00Z.
The prologue now runs into the world, but the screen is mostly black. A census of one world frame on main (20 frames, M5 Pro 48 GB, Series S) traced the render chain from the G-buffer to the present:
CopyResourceof G-buffer targets5f8b2e3b4d8e5faa(wave64, 8x8, 160x90 groups) → HDR scene colour, fmt 10 1280x72041e09588771fe7a0(vertex7a7f9ab1d7449a22) → fmt 10 1920x1080So a first lit image needs the lighting compute and the upscale, plus enough G-buffer coverage for there to be something to light.
Being worked on:
5f8b2e3b: per-shape lane-mask rules, plus a general fallback (see #4).user(texcoord8), ~219 drops a frame), "Metal XPC interrupted" compiles, "a descriptor outside the heaps".Testers: no new run needed for this yet. Dumps with
VICTORY_TRACE_TARGETS=1 VICTORY_DUMP_TARGETS=<dir>,<s>,<every>are welcome once fixes land (keep the images to yourself; post the non-black percentages).Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T23:28:54Z.
Progress: main
970b1851translates the lighting compute5f8b2e3b4d8e5faa(three new lane-mask join rules, each with a Metal test). In a warm run its dispatches are no longer dropped, and the HDR target gets 57–61 draws a frame (was 8), with lit values up to 330–5,800 (was about 1e-5). It is still dim (0.2–0.45 % of pixels lit) because the G-buffer is mostly empty, and nothing reaches the window until the upscale pixel shader41e09588translates. Those two are next.34b67644also translates offline now.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T00:20:09Z.
Progress: main
fd861760.41e09588translates (its root constants extend past the one SGPR the metadata names; a guess, documented). The 1920x1080 fmt 10 target gets its first draws.user(texcoordN)mismatch): those drops went from ~48 a frame to 0. "A descriptor outside the heaps": ~21 a frame to 0 (descriptors swapped with three XORs are followed).Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T01:27:34Z.
Landed
df21edf3and8d6688econ main: the "descriptor changed after loading" refusal goes from about 1,550 per dumped set to 0 offline, and 300 to 0 in a warm Series S run, with no regressions. Two fixes: a 64-bit move of the VCC pair is now only a weak sign of wave64 in a guessed graphics program (a wave32 pixel shader was being treated as wave64, so a compare overwrote dword 0 of a descriptor); and a buffer descriptor made raw (dword 1 masked with 0xc000ffff) now serves a tbuffer load of its own format. About 30 more shaders per set translate fully; the rest stop at the next refusal, mostly "an address into a descriptor heap with an untracked high half" (~660 offline, 195 in game), which is next.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T01:41:18Z.
Landed
c3d328b4(dc5223b6,3911f3d2): a guessed pixel program's root constants reach up to its primitive-mask SGPR, and M0 never set in a compute program is taken as LDS address 0 (a guess, marked as one). Render pipelines compile with a 10 s deadline, and a Metal compiler crash (XPC error) is remembered on disk by DXIL and macOS build and refused early on later runs. Warm Series S run on the branch: hardware-SGPR refusals 5 to 0, the upscale pipeline's refusals 5 to 0, XPC errors 6 to 0, no GPU errors. Both runs stalled before the world (the silent stall), so G-buffer drops per frame were not measured from this build.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T01:51:14Z.
Landed
288d749d(30d97e68,3ac2147b,269e7d55): wave32 lane-mask joins with per-half constants and masks copied away and back; a mesh program's SCC of EXEC; SGPR spills read back after a join become a phi of the spilled SGPRs; a three-XOR swap's last XOR is a copy. The six wave32 G-buffer compute programs (4359f972, d8ff071a, e456bd43, 3a137e94, 5e820fc2, c56c4093) and the three NGG vertex programs (08173be1, d7447e18, f537f5a1) translate. Dumped corpora: compute 347 to 403, vertex 8,121 to 8,189, no regressions. Warm Series S run: refused shaders 110 to 83, no GPU errors; it stalled before the world (the silent stall the lead is on), so G-buffer drops per frame are not measured yet.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T02:52:32Z.
Landed
b033c56c: HDR pixel-shader fixes (v_readlane of a whole-wave reduction, and further lane-mask rules). Offline, pixel shaders that translate went 7,510 -> 7,606 with no regressions in pixel or vertex shaders. One game run (alone, cold cache) reached title shaders with no GPU errors and no refusal class the previous run lacked; refused shaders 83 -> 25, though the run also ended earlier at the known first-frame stall, so the count is not a like-for-like comparison. "data, on the host's lanes" refusals went 9 -> 0 in that run. Not included: a further unneeded_edges rule (+273 pixel shaders offline), which has had no game run yet.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T03:08:52Z.
Landed
2fa17f16: a further lane-mask rule (unneeded_edges accepts an s_andn2-by-EXEC read where every lane of the edge is in EXEC, and reads in another block when neither block is on a cycle). Offline, pixel shaders that translate went 7,606 -> 7,879 with no pixel or vertex regressions; lane-mask join refusals 285 -> 24. One cold game run reached title shaders with no GPU errors and no new refusal class (27 refused; the two over the previous run were already refused in older runs, reached because this run got further). The run does not show any of the newly translating shaders being drawn; it shows the rule breaks nothing in the part of the game reached.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T04:00:52Z.
Landed
72471c5f: fixes a wrong accept that our landing288d749d(commit22158558) introduced, and which has kept the Windows CI testsynthetic_tests::a_compare_mask_joined_with_data_on_the_skip_edge_is_0_therered since. On a per-lane skip edge, a constant or lane function is now refused when another edge of the join brings a mask that may differ from it in a skipping lane (Lower::mask_differs_on_edge); the older all-or-none constant rule had the same fault with a constant 0 and gets the same guard. New cross-platform testlower::tests::a_skip_edge_constant_is_not_the_bit_where_the_arm_keeps_the_skipping_lanesfails without the guard, including for an if inside a loop. The pattern ina_pixel_program_joins_data_an_else_part_clears_with_its_execstill translates. Not yet verified: the Windows-only test itself (CI will show it), and the full corpus comparison, which is still running. Note for #237: it fixes the same case but, merged onto main, also refuses that else-part pattern, which main translates correctly.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T04:07:29Z.
Follow-up
19788c59: the skip-edge guard from72471c5fis narrowed to thest.otherarm only. A corpus comparison (run after72471c5flanded) showed the guard on the older all-or-none arm refused pixel shaders that have translated since before22158558; one read in detail (a wave64 loop with a per-lane break, where the mask is only OR-ed with EXEC) was translated correctly before, the structure just cannot prove it. That arm is back to its earlier text. Its unproven constant-0 case is kept as a known gap: ignored testlower::tests::a_skip_edge_constant_of_no_lane_is_not_the_bit_eitherand a note in docs/native-host.md. Corpus counts for this variant are still running.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T04:30:05Z.
Landed
d77e766d: the skip-edge guard is made more precise. When the skip edge brings a join made in its own block (an if's then part writes the register and the edge skips the else part),mask_differs_on_edgeweighs each edge into that block for its own lanes. Corpus (33,625 shaders, by output fingerprint, against19788c59): all 104 pixel shaders the guard had refused translate again with exactly the output they had before the guard; nothing else changes. Still refused from this morning's 154: 46 vertex and 4 compute. Of the four compute shaders, three look correctly translated before (from reading the disassembly, not proven) and need two further proofs: OR-then-remove loop masks, and EXEC narrowing inside an arm. Testlower::tests::a_then_parts_constant_on_the_else_skip_edge_is_weighed_for_its_own_lanescovers the accepted shape and a twin that stays refused.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T05:32:19Z.
Update and call for help in #258: the six culling compute shaders now run in every world frame, but still write zero counts into the mesh records, so the world stays black. Bugs found on the way: #254, #255, #256, #257.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T05:39:04Z.
Closing this in favour of #258, which continues it. The lighting compute and the upscale pixel shader now translate. The remaining problem, the culling compute writing zero counts into the mesh records, is tracked in #258.