GPU: clamp every host view heap to a null slot, and key the shader cache by it #50
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/50"
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 Zettrox/ztrx. Originally posted by Altorru on 2026-11-25T06:07:57Z.
Ports the GPU half of
fxceless/victory-fork@31714de; the patch applied cleanly to the current GPU code.Why: a view index past a heap's end is undefined. NVIDIA hung on it (heap capped at 1,000,000 views), and AMD RDNA3 took a page fault and removed the device on entering the world: a compute program read view slot 16,777,088 of a 1,507,328-view heap.
What:
probe_view_limitnow picks a null slot at the end of every host view heap (2^21 views where the host takes them, else PORTABLE_VIEWS) and appliesset_view_heap_limitfrom the first shader on.HostHeap::newsizes the heap to that slot, leaves descriptors past the limit reading null, and records the real size. The shader cache key now includes the limit (it differs by GPU), so a translation cached without the clamp is not served. Addsview_heap_limit()besideset_view_heap_limit.Verification:
cargo check -p victory-shaderandcargo test -p victory-shaderpass (170 tests). The GPU crate cannot be compiled on this macOS host (onlyaarch64-apple-darwinstd is installed and the Rust download endpoint is unreachable;victory-gpualso has pre-existing macOS cfg errors), so Windows CI is the first build. Reviewed against the currentHostHeap/probe_view_limitcode: all referenced symbols exist andprobe_view_limitis already called frompipeline.rsbefore translation.Imported from Zettrox/ztrx. Originally posted by ThomasHFWright on 2026-11-25T08:40:33Z.
Tested the unmodified PR head
7a84f7d207c5a4d4e15374a11a3cb3e77b8931e5on Linux/RTX 5090. The early clamp activates correctly, but this run still fails at world entry; no world geometry confirmed. Baseline/runtime comparison: https://github.com/Zettrox/ztrx/issues/62#issuecomment-7157043010The probe change matters on this host: vkd3d accepts the old 1,000,001-view probe, but reports a maximum of 1,041,451 and rejects the subsequent 1,507,328-view heap. Here the new 2^21 probe is rejected and the 1,000,000-view/null-slot limit is established before the first shader translation. The startup log confirms that ordering.
Validation:
a_mesh_pipeline_loads_from_the_library,a_rejected_blob_gives_an_empty_library,stub_pipeline_is_created. Tests ran separately on distro Wine 11.22 with native D3D12 DLLs, not under the full game launcher.Game run: Ryzen 7 9800X3D, RTX 5090, NVIDIA 620.73.04, CachyOS Linux 7.3.6; GE-Proton11-14 host/umu 1.4.3 with the D3D12 pair from Proton Experimental
experimental-11.0-20261112-x86_64. Loaded vkd3d2576c0b4adfae4averified.VK_NV_raw_access_chainsdisabled; otherwise plain release/default speed settings. Fresh prefix, cache and save data; offline network namespace and read-only game input.Setup/legal screens worked, then the prologue title card. Kernel Xid 13/MMU fault recurred at 08:39:13 UTC on 2026-11-25. The app exited itself with code 5 after 558.11 seconds, before the 900-second bound. Three Wine thread-stack overflows and the same final title null-write exception (
0xc0000005, offset0x23cf683) remain. Four compute pipelines were refused, including2cc4c197ee29e291; no mesh-pipeline refusal was logged. Last statistics were 0.6 fps, 2,028 draws/frame and 1,806 dropped without a pipeline (859 still compiling), plus 1,073 indirect drops. These are startup statistics, not gameplay performance.Important limitation: same cgroup limits as the comparison runs (10 GiB high, 14 GiB max, 8 GiB swap). It reached the high threshold; peak swap was about 7.4 GiB and minimum host available memory about 1.5 GiB. No cgroup OOM or kill occurred, but memory pressure is still a confounder. This single run validates the probe/clamp behavior, not a general verdict on crash prevention. No other PRs were combined; no game assets, generated shaders, raw logs or captures attached.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.