Skip to content

docs: triage the two crashes past the old hang point - #1

Open
thedanmaor wants to merge 12 commits into
fix/nvidia-heap-clampfrom
fix/post-hang-crashes
Open

thedanmaor wants to merge 12 commits into
fix/nvidia-heap-clampfrom
fix/post-hang-crashes

Conversation

@thedanmaor

Copy link
Copy Markdown

Stacked on Marvisak#2185 (fix/nvidia-heap-clamp). Docs only. This triages the two crashes that end runs after the hang fix.

  • Frame 1797, driver AV in mesh CreatePipelineState: the driver executed 0x77fc4bd42980. That boot, nvwgf2umx.dll was at 0x7ffc4bb70000, so the address differs in a single bit (bit 43) from nvwgf2umx+0x1d2980. A single-bit flip suggests hardware rather than a bad pipeline description. An offline build of all 28164 pack pipelines did not crash.
  • Frame 1699, title int3: this is the title pool allocator's empty-pool trap. A run that polled both pools reached frame 1928 without crashing. Both pools stayed under 45% of capacity with no growth trend, so there is no sign of an emulator-caused leak.

No code change. Neither crash reproduced.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YN3qACnpWeybNLkKL5h5jr

222dmx222 and others added 12 commits November 25, 2026 09:02
NVIDIA caps shader-visible CBV/SRV/UAV heaps at 10^6 slots; the world
indexes past that (slot 1,236,191 and up), and with shaders clamping only
below HEAP_VIEWS (2^21) the device was removed (DXGI_ERROR_INVALID_CALL).

The host probes a HEAP_VIEWS heap at device creation; where it is refused,
emit::set_heap_views(PORTABLE_VIEWS) makes translated shaders clamp below
the cap and put the null buffer views at its last slots. The capped host
heap keeps the title slots below the dynamic range; title slots past it
read null. The heap size keys the shader cache and the pipeline library.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
use_shader_cache hashed heap_views() before the host was made, so the
OnceLock locked at HEAP_VIEWS (2M) and the GTX 1660's 1M cap never took:
no shader-visible view heap, and shaders indexed past it (MMU fault,
nvlddmkm event 13). Make the host first; set_heap_views now reports
whether the cap applied, and the host logs if it came too late.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YN3qACnpWeybNLkKL5h5jr
…op below HEAP_VIEWS

NVIDIA caps shader-visible view heaps at 10^6 slots; the test host's
View::NullBuffers needs HEAP_VIEWS (2^21), so the hardware run failed
with E_INVALIDARG instead of testing anything. WARP still runs it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YN3qACnpWeybNLkKL5h5jr
Translated shaders read every structured buffer through a raw handle at
index * stride + offset. NVIDIA reads a structured view through a raw
handle wrongly. So structured views with a stride that is a multiple of 4
are now made as R32_TYPELESS raw views, with their range scaled to
4-byte words. Their host copy starts on 16 bytes, which is the raw-view
alignment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YN3qACnpWeybNLkKL5h5jr
…oval)

The GTX 1660 has no typed UAV support for B5G5R5A1_UNORM (86).
CreateUnorderedAccessView on an 86 texture removed the device with
DXGI_ERROR_INVALID_CALL about 8 s into the title. Only cross-family casts
were checked. Now every unordered view's final format is checked: the
title's format, or the texture's own. If the host cannot store to it, the
slot stays null.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YN3qACnpWeybNLkKL5h5jr
- Reserve the 3 null-buffer-view slots in every view-heap size, so a title
  count just under the NVIDIA cap falls through to the capped heap instead
  of overlapping the null views.
- Clamp structured-as-raw views to the host's 2^27 buffer elements.
- Refuse typed UAVs unless the format also reports UAV_TYPED_STORE.
- Correct the docs: title indices past the kept slots on a capped heap
  read dynamic or null views, not always empty ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YN3qACnpWeybNLkKL5h5jr
… hang)

On a capped heap (GTX 1660: 10^6 views, 934461 title slots kept) the
view-addresses table held only the kept title slots. Translated shaders
read it through a root SRV, which has no bounds, at indices clamped
only below heap_views, up to ~524 KB past the buffer. That hung the
BVH traversal f607780aa8e502d0 (DEVICE_HUNG, no page fault) between
frames ~1340 and ~1603 on Series X and Series S.

The strides, marks and view-address tables now share indexed_slots().
Heap-direct title indices past the kept slots go to the null last slot
(title_guard). After review: a capped host keeps a heap of exactly
heap_views unless everything fits under it, and the uncapped fallback
keeps room for the dynamic and null slots again.

Verified on GTX 1660 Super: Series X runs to frame 1699 and Series S to
frame 1929 with no removal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YN3qACnpWeybNLkKL5h5jr
The frame-1797 driver AV jumped to a valid nvwgf2umx address with one bit
flipped (bit 43), which points at hardware rather than a pipeline. An
offline build of all 28164 pack pipelines did not crash. The frame-1699
int3 is the title pool allocator's empty-pool trap; a run that polled both
pools reached frame 1928 with them under 45% full and not growing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YN3qACnpWeybNLkKL5h5jr
@thedanmaor
thedanmaor force-pushed the fix/nvidia-heap-clamp branch from 009277b to 3417025 Compare November 25, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants