You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Retail title on NVIDIA: root-cause fixes log (each with its cause, evidence and code) #2952
A running log of fixes for the retail title where the root cause is shown, the fix is on by default (not behind an env switch), and the result was measured in the world on our machine. Each entry is its own comment below, with the cause, the evidence, the fix (code in the comment when it is ours and small) and what was ruled out. This issue gets updated as entries land.
The goal is that others can take a fix as it is, instead of collecting switches. Workarounds that only hide a symptom (refusing programs, budgets that drop work, barriers added "because it stops hanging") do not go here. If you have an entry of that kind, or a correction to one of ours, please add it in the same format.
Machine: RTX 5070 Ti 16 GB (driver 621.01), Ryzen 7 9700X, 62 GB RAM, Windows 11 26300, render 2560x1440. Tree:nvidia-dev-based lab tree (MacieGx's lab plus our changes).
1. Loading-art flicker: the first write to a cold block reaches the GPU unseen
Symptom. On the loading art, single frames of black or of the background without the character layer, in a cycle of about 216 frames (96 flashes in 50 s here). Reported also on an RTX 4080 (#2572) and an RTX 3090 (#2917).
Cause.7c18bc41 (on nvidia-dev, not on main) makes each look for CPU writes before a submit take only the 2 MiB blocks written in the last hot_for (1,500 ms), while a background walk finds writes to the other blocks later. A block that has gone cold and gets written just before a submit is uploaded late: the GPU reads the stale copy for that frame. Evidence: XCL_WATCH_HOT=0 gives 0 flashes in 85 s, and XCL_WATCH_HOT_MS=10000 also removes them, at a cost in fps.
Fix (ours, default on): write guards on cold blocks. A block that leaves the hot set is set PAGE_READONLY by a guard thread. The next look reads its write-watch bits one last time, then leaves it alone. The first write to it faults into a lock-free vectored handler, which makes the block writable again, puts it back in the hot set and lets the write retry. So the looks stay as cheap as with 7c18bc41, and no first write is missed.
XCL's own writers have to open the blocks first: ReadFile (including OVERLAPPED), DirectStorage, physical-page copies and CLZERO emulation. The VirtualProtect/Alloc/Free/Query hooks and cpu_writes know about the guards too, and the title's protect/commit/free calls pin the blocks across the call. About 1,500 lines over 13 files, so we describe it rather than paste it. Ask if you want a part of it.
Measured: 0 flashes in 85 s and 0 leaks (no block left writable without being hot), with no fps cost against hot looks. The simpler alternative, if you don't need the hot-look speed, is MacieGx's 240037e7, which turns hot looks off by default.
2. Direct DXIL division: an overflowed quotient became NaN
Cause. The direct translator's v_div_scale_f32 returns its source unscaled and clears VCC, so the f32 division sequence (rcp, Newton fmas, v_div_fmas, v_div_fixup) can overflow where the hardware's scaled sequence never does. q = n·rcp(d) becomes Inf, the next fma(-d, q, n) gives -Inf, and the step after that gives NaN. div_fixup then returned that NaN for finite operands. #1144 fixed div_fixup and v_div_fmas_f32 in the HLSL path only; with XCL_DIRECT_DXIL=1 the bug stayed. A NaN in HDR shows as black and spreads through bloom, so we checked it.
Fix.#1144's rules, ported to dxil/prelude.rs (div_fixup). Each select wins over the ones before it:
pubfndiv_fixup(&mutself,q:Value,d:Value,n:Value) -> Value{let(qu, du, nu) = (self.bits(q),self.bits(d),self.bits(n));let abs = self.c(0x7FFF_FFFF);let(qa, da, na) = (self.and(qu, abs),self.and(du, abs),self.and(nu, abs));let x = self.xor(du, nu);let top = self.c(0x8000_0000);let sign = self.and(x, top);let inf = self.c(0x7F80_0000);let zero = self.c(0);let quiet = self.c(0x0040_0000);let signed_inf = self.or(sign, inf);letmut r = self.or(sign, qa);let q_nan = self.cmp(Pred::UGt, qa, inf);
r = self.sel(q_nan, signed_inf, r);// overflowed quotient: ±Inflet ff = self.c(0xFF);let nsh = self.lshrc(nu,23);let en = self.and(nsh, ff);let dsh = self.lshrc(du,23);let ed = self.and(dsh, ff);let k150 = self.c(150);let en150 = self.add(en, k150);let under = self.cmp(Pred::ULt, en150, ed);
r = self.sel(under, sign, r);// exponent gap under -150: ±0let d_inf = self.cmp(Pred::Eq, da, inf);let n_zero = self.cmp(Pred::Eq, na, zero);let to_zero = self.lor(d_inf, n_zero);
r = self.sel(to_zero, sign, r);// x/Inf, 0/xlet d_zero = self.cmp(Pred::Eq, da, zero);let n_inf = self.cmp(Pred::Eq, na, inf);let to_inf = self.lor(d_zero, n_inf);
r = self.sel(to_inf, signed_inf, r);// x/0, Inf/xlet zz = self.land(d_zero, n_zero);let ii = self.land(d_inf, n_inf);let invalid = self.lor(zz, ii);let nan = self.c(0xFFC0_0000);
r = self.sel(invalid, nan, r);// 0/0, Inf/Inflet d_nan = self.cmp(Pred::UGt, da, inf);let dq = self.or(du, quiet);
r = self.sel(d_nan, dq, r);let n_nan = self.cmp(Pred::UGt, na, inf);let nq = self.or(nu, quiet);
r = self.sel(n_nan, nq, r);// NaN operands, the numerator's firstself.f(r)}
In dxil/lower_valu.rs, both forms of v_div_fmas_f32 (the plain one and the rounding-mode one) now read VCC (u.get(3), Src::Pair) and select ldexp_f(r, 32) for lanes where it is set, as the HLSL path does since #1144.
Tested:#1144's gpu_div_fixup_f32_special_cases_and_sign and gpu_div_fmas_f32_scales_by_vcc pass with and without XCL_DIRECT_DXIL=1 (3/3 in each). The VCC test failed on the direct path before the change.
Not a fix for our dark cell. The black window stayed the same. A follow-up for quotients that come out as 0 or Inf from an unscaled reciprocal will be its own entry once it is measured in the world.
4. Single-record clamp: no 1,024-thread scan for one 12-byte record
Cause. Each two-pass mesh draw of this title (~3,700 a frame, all single-record ExecuteIndirect(DispatchMesh) with no count buffer) bounds its record with indirect_clamp.hlsl's main: one group of 1,024 threads, a prefix scan and about 23 group syncs, all for one record.
Fix. A second entry point in indirect_clamp.hlsl, chosen in bound_within when max == 1 && count_buf == 0. Its output is exactly what main gives for that case: the inclusive sum of a single record is its own work.
[numthreads(1, 1, 1)]
voidsingle_record() {
for (uint k = 0; k < stride; k += 4)
bounded.Store(k, source.Load(source_at + k));
uint3 a = source.Load3(source_at + action_at);
uint work = clamp_args(a);
if (work > budget) {
if ((kind & 0xFF) <= 1)
a.y = 0;
else
a = uint3(0, 0, 0);
}
bounded.Store3(action_at, a);
}
The pipeline is made on first use from the same root signature, and falls back to main if it fails.
Tested: a GPU test runs both entry points over 8 cases and compares every output byte: a normal record, garbage (0xFFFFFFFF), zero, over budget, exactly at budget, fold, and draws with fields outside the action.
Measured: in the world, frames 3000–3600 take 134–135 ms against 137 ms. It is small, but it holds across runs.
Activity
claudetools-gh commentedon Nov 27, 2026
1. Loading-art flicker: the first write to a cold block reaches the GPU unseen
Symptom. On the loading art, single frames of black or of the background without the character layer, in a cycle of about 216 frames (96 flashes in 50 s here). Reported also on an RTX 4080 (#2572) and an RTX 3090 (#2917).
Cause.
7c18bc41(onnvidia-dev, not onmain) makes each look for CPU writes before a submit take only the 2 MiB blocks written in the lasthot_for(1,500 ms), while a background walk finds writes to the other blocks later. A block that has gone cold and gets written just before a submit is uploaded late: the GPU reads the stale copy for that frame. Evidence:XCL_WATCH_HOT=0gives 0 flashes in 85 s, andXCL_WATCH_HOT_MS=10000also removes them, at a cost in fps.Fix (ours, default on): write guards on cold blocks. A block that leaves the hot set is set
PAGE_READONLYby a guard thread. The next look reads its write-watch bits one last time, then leaves it alone. The first write to it faults into a lock-free vectored handler, which makes the block writable again, puts it back in the hot set and lets the write retry. So the looks stay as cheap as with7c18bc41, and no first write is missed.XCL's own writers have to open the blocks first:
ReadFile(including OVERLAPPED), DirectStorage, physical-page copies and CLZERO emulation. TheVirtualProtect/Alloc/Free/Queryhooks andcpu_writesknow about the guards too, and the title's protect/commit/free calls pin the blocks across the call. About 1,500 lines over 13 files, so we describe it rather than paste it. Ask if you want a part of it.Measured: 0 flashes in 85 s and 0 leaks (no block left writable without being hot), with no fps cost against hot looks. The simpler alternative, if you don't need the hot-look speed, is MacieGx's
240037e7, which turns hot looks off by default.AI-assisted.
claudetools-gh commentedon Nov 27, 2026
2. Direct DXIL division: an overflowed quotient became NaN
Cause. The direct translator's
v_div_scale_f32returns its source unscaled and clears VCC, so the f32 division sequence (rcp, Newton fmas,v_div_fmas,v_div_fixup) can overflow where the hardware's scaled sequence never does.q = n·rcp(d)becomes Inf, the nextfma(-d, q, n)gives -Inf, and the step after that gives NaN.div_fixupthen returned that NaN for finite operands. #1144 fixeddiv_fixupandv_div_fmas_f32in the HLSL path only; withXCL_DIRECT_DXIL=1the bug stayed. A NaN in HDR shows as black and spreads through bloom, so we checked it.Fix. #1144's rules, ported to
dxil/prelude.rs(div_fixup). Each select wins over the ones before it:In
dxil/lower_valu.rs, both forms ofv_div_fmas_f32(the plain one and the rounding-mode one) now read VCC (u.get(3),Src::Pair) and selectldexp_f(r, 32)for lanes where it is set, as the HLSL path does since #1144.Tested: #1144's
gpu_div_fixup_f32_special_cases_and_signandgpu_div_fmas_f32_scales_by_vccpass with and withoutXCL_DIRECT_DXIL=1(3/3 in each). The VCC test failed on the direct path before the change.Not a fix for our dark cell. The black window stayed the same. A follow-up for quotients that come out as 0 or Inf from an unscaled reciprocal will be its own entry once it is measured in the world.
AI-assisted.
claudetools-gh commentedon Nov 27, 2026
4. Single-record clamp: no 1,024-thread scan for one 12-byte record
Cause. Each two-pass mesh draw of this title (~3,700 a frame, all single-record
ExecuteIndirect(DispatchMesh)with no count buffer) bounds its record withindirect_clamp.hlsl'smain: one group of 1,024 threads, a prefix scan and about 23 group syncs, all for one record.Fix. A second entry point in
indirect_clamp.hlsl, chosen inbound_withinwhenmax == 1 && count_buf == 0. Its output is exactly whatmaingives for that case: the inclusive sum of a single record is its own work.The pipeline is made on first use from the same root signature, and falls back to
mainif it fails.Tested: a GPU test runs both entry points over 8 cases and compares every output byte: a normal record, garbage (
0xFFFFFFFF), zero, over budget, exactly at budget, fold, and draws with fields outside the action.Measured: in the world, frames 3000–3600 take 134–135 ms against 137 ms. It is small, but it holds across runs.
AI-assisted.