Fix descriptor pressure, sparse mip uploads, and in-place heap fallback #30

Closed
github-bot wants to merge 5 commits from gh-pr/30/head into gh-pr/30/base
Owner

@⁠Xyzstk on GitHub · 2026-11-26 19:12 UTC · original
Xyzstk:fix/runtime-descriptor-and-mip-pressure → main · +720 −43 · 8 files · 5 commits · closed without merging

On a Windows NVIDIA system with an 8 GB VRAM budget, the opening world dropped descriptor-bound draws and failed to use streamed texture mips. This change shares overlapping graphics-stage snapshots, honors sparse allocation requests, and makes the existing in-place graphics-heap path recognize the reservation form used at runtime. It also prevents a cold launch from losing persistent head initialization.

The commits address separate runtime problems:

  • Share the largest valid native descriptor-table extent across graphics stages of a draw. Keep original descriptor indices, indexed offsets, deferred constant reads, and each stage's resource-readiness checks.
  • Compare overlapping 64 KiB checksum pieces once per copy and comparison mode. Retain the original byte ranges for readback and share the first changed flag before the baseline is updated.
  • Bypass committed texture pooling for reserved-resource requests, permit sparse mip chains on read-only address-backed textures, and refresh staging before sparse mapping consumes its mip mask. First sparse uploads fill mapped pages even with the no-wait path enabled.
  • Resolve CS_ComputeBlendshapeMappings before its first dispatch, outside the ordinary compilation wait budget, so a missed one-time producer cannot leave later skinning without initialized inputs.
  • Track low-address placeholders requested directly with MEM_RESERVE_PLACEHOLDER. Previously only the console PAGES_64K form was tracked, so page arrangement never ran for the native form and renderer port 1 fell back with Scattered.

Validation on Windows / NVIDIA:

  • The synthetic descriptor regression reproduces separate 6 + 128-slot allocations failing with 130 free slots; one shared 128-slot snapshot succeeds and GPU reads retain the original slots and constants changed after recording.
  • GPU checksum regression verifies shared changed flags, one baseline update, and unchanged readback bounds. The opt-in synthetic 64 MiB benchmark reduced checksum time from 0.7342 to 0.2724 ms; this is not a full-frame measurement.
  • Sparse allocation/upload integration verifies explicit and implicit full mip counts, preserved dimensions, actual physical tile allocation for mapped pages, and the original allocation path for fully mapped and GPU-written textures.
  • The new native-placeholder regression failed before the fix and passes after it; all 18 memory-mapping tests pass, with one existing ignored test.
  • Asset policy and patch whitespace checks pass. Release build succeeds. Shader suite: 284 passed, 4 ignored. The earlier diagnostics GPU suite reported 392 passed and 36 ignored. The final default-feature GPU suite completes with --test-threads=1: 343 passed, 36 ignored, and two existing indirect-budget failures, host_list_budget_starts_empty_at_each_submission and warp_batch_charges_every_execution. A parallel default-feature rerun exited abnormally with 0xc0000409; its cause remains unisolated. The focused sparse upload regression passes separately on the GPU.

Runtime results with Series S and the existing shader/pipeline cache:

  • Sparse fixes changed the observed sparse-texture count from zero to about 1,120, backed by about 150 MB of physical tiles. Retained unmapped-mip storage fell from roughly 1.6 GB to 0.8 GB. The user confirmed restored wire mesh and other details.
  • The native-placeholder fix changed renderer port 1 from zero opened regions and a 174 MB startup buffer-mirror span to one 185 MB in-place region and a zero startup buffer-mirror span. The user confirmed faces, wire mesh, and additional details remain visible, with more detail rendered than in the preceding run.
  • The two latest world runs reported no temporary descriptor-allocation failures or device removal. Their median frame times were approximately 441 and 430 ms. Scene progression differed, so these numbers do not establish a reliable frame-rate improvement. Constant-buffer tables still take the copying fallback on this capped NVIDIA heap; remaining memory pressure and missing rendering need further work.

Reviewed the open PR list and inspected the potentially overlapping changes in #8, #25, #27, and #29. #25 changes wave32 shader lowering, and #27 pools texture readbacks; neither implements these runtime fixes. The changes are based on upstream 3277b15 and contain implementation code and synthetic tests.

**@⁠Xyzstk** on GitHub · 2026-11-26 19:12 UTC · [original](https://github.com/DoubleGhosty/cool_fox/pull/30) `Xyzstk:fix/runtime-descriptor-and-mip-pressure` → `main` · +720 −43 · 8 files · 5 commits · closed without merging On a Windows NVIDIA system with an 8 GB VRAM budget, the opening world dropped descriptor-bound draws and failed to use streamed texture mips. This change shares overlapping graphics-stage snapshots, honors sparse allocation requests, and makes the existing in-place graphics-heap path recognize the reservation form used at runtime. It also prevents a cold launch from losing persistent head initialization. The commits address separate runtime problems: - Share the largest valid native descriptor-table extent across graphics stages of a draw. Keep original descriptor indices, indexed offsets, deferred constant reads, and each stage's resource-readiness checks. - Compare overlapping 64 KiB checksum pieces once per copy and comparison mode. Retain the original byte ranges for readback and share the first changed flag before the baseline is updated. - Bypass committed texture pooling for reserved-resource requests, permit sparse mip chains on read-only address-backed textures, and refresh staging before sparse mapping consumes its mip mask. First sparse uploads fill mapped pages even with the no-wait path enabled. - Resolve `CS_ComputeBlendshapeMappings` before its first dispatch, outside the ordinary compilation wait budget, so a missed one-time producer cannot leave later skinning without initialized inputs. - Track low-address placeholders requested directly with `MEM_RESERVE_PLACEHOLDER`. Previously only the console `PAGES_64K` form was tracked, so page arrangement never ran for the native form and renderer port 1 fell back with `Scattered`. Validation on Windows / NVIDIA: - The synthetic descriptor regression reproduces separate 6 + 128-slot allocations failing with 130 free slots; one shared 128-slot snapshot succeeds and GPU reads retain the original slots and constants changed after recording. - GPU checksum regression verifies shared changed flags, one baseline update, and unchanged readback bounds. The opt-in synthetic 64 MiB benchmark reduced checksum time from 0.7342 to 0.2724 ms; this is not a full-frame measurement. - Sparse allocation/upload integration verifies explicit and implicit full mip counts, preserved dimensions, actual physical tile allocation for mapped pages, and the original allocation path for fully mapped and GPU-written textures. - The new native-placeholder regression failed before the fix and passes after it; all 18 memory-mapping tests pass, with one existing ignored test. - Asset policy and patch whitespace checks pass. Release build succeeds. Shader suite: 284 passed, 4 ignored. The earlier diagnostics GPU suite reported 392 passed and 36 ignored. The final default-feature GPU suite completes with `--test-threads=1`: 343 passed, 36 ignored, and two existing indirect-budget failures, `host_list_budget_starts_empty_at_each_submission` and `warp_batch_charges_every_execution`. A parallel default-feature rerun exited abnormally with `0xc0000409`; its cause remains unisolated. The focused sparse upload regression passes separately on the GPU. Runtime results with Series S and the existing shader/pipeline cache: - Sparse fixes changed the observed sparse-texture count from zero to about 1,120, backed by about 150 MB of physical tiles. Retained unmapped-mip storage fell from roughly 1.6 GB to 0.8 GB. The user confirmed restored wire mesh and other details. - The native-placeholder fix changed renderer port 1 from zero opened regions and a 174 MB startup buffer-mirror span to one 185 MB in-place region and a zero startup buffer-mirror span. The user confirmed faces, wire mesh, and additional details remain visible, with more detail rendered than in the preceding run. - The two latest world runs reported no temporary descriptor-allocation failures or device removal. Their median frame times were approximately 441 and 430 ms. Scene progression differed, so these numbers do not establish a reliable frame-rate improvement. Constant-buffer tables still take the copying fallback on this capped NVIDIA heap; remaining memory pressure and missing rendering need further work. Reviewed the open PR list and inspected the potentially overlapping changes in #8, #25, #27, and #29. #25 changes wave32 shader lowering, and #27 pools texture readbacks; neither implements these runtime fixes. The changes are based on upstream `3277b15` and contain implementation code and synthetic tests.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 06:07:19 +00:00
github-bot closed this pull request 2026-11-27 06:07:19 +00:00
Author
Owner

@⁠DoubleGhosty on GitHub · 2026-11-26 20:07 UTC · original

Merged into main via 46714eb with native placeholder tracking, sparse mip allocation handling, and blendshape pre-dispatch initialization. Verified with cargo clippy and test suite.

**@⁠DoubleGhosty** on GitHub · 2026-11-26 20:07 UTC · [original](https://github.com/DoubleGhosty/cool_fox/pull/30#issuecomment-7202332245) Merged into main via 46714eb with native placeholder tracking, sparse mip allocation handling, and blendshape pre-dispatch initialization. Verified with cargo clippy and test suite.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.