WIP: GPU-written texture mips kept, heat haze back with early depth, alias copy layout guard, hot-page tests #600

Draft
deama wants to merge 46 commits from deama/Darner:pr/7-texture-mips-heat-haze-alias-copies into Main
First-time contributor

Not run in the game on Darner. Ported from a local VIctory-NVIDIA branch (before the rename). The game checks quoted below were made on that branch, not on this port.

Contributor role (optional)

  • Fluxer ID:

What it changes

  • The problem on main: (1) a CPU refresh of a texture can overwrite mip levels the GPU copied into it earlier in submission order. (2) darner play leaves the heat-haze pass out entirely, together with face relocation.

Six commits:

  • Preserve copied texture mips in submission order while refreshing untouched levels

  • Enable validated GPU-written mip preservation for normal play

  • Validate hot-page coherence and lifetime on software and RTX adapters

  • rendering: restore heat haze with the native early-depth correction

  • gpu: guard alias copy layouts and support controlled direct-copy comparisons

  • diagnostics: observe alias-copy overlap with write-capable bindings

  • DARNER_GPU_WRITTEN_MIPS=1: per-subresource ownership (after lobomfz/VIctory-xmem 2039e43). Levels the GPU wrote earlier in submission order are kept, and untouched levels are still refreshed. Atlas and external-write protection stay conservative. Masks are captured before parallel preludes, and this is merged with main's texture hoisting. darner play sets it to 1.

  • Heat haze: darner play and build-darner.ps1 now leave out only face relocation (02384a60fda6f2d0). The heat-haze compute (731a39171b568298) runs, but the pipeline policy withholds it whenever DARNER_EARLY_DEPTH is off, since it needs the native early-depth correction. With frame generation on or made ready, both stay left out as before. An explicit DARNER_LEAVE_OUT still wins. The F1 row has three values, with new en and zh-CN strings.

  • Alias copies: layouts are checked against the textures before reuse, and direct texture-to-texture copies can be compared in a controlled way (DARNER_ALIAS_PROFILE, DARNER_ALIAS_OVERLAP diagnostics). DARNER_ALIAS_DIRECT stays off here: turning it on by default is #282's change.

  • Hot-page coherence and lifetime tests (software adapter, plus an RTX run when DARNER_TILED_TEST_HARDWARE=1). Declared view ranges are labelled as estimates.

How it was tested

  • Tested revision: 58c3be48ea
  • Commands and results: on 58c3be48ea (this branch's head), Windows 10 22H2 with its built-in Direct3D 12 (no Shader Model 6.6), Rust 1.98.1:
    • cargo clippy --workspace --all-targets --locked -- -D warnings: passed
    • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passed
    • cargo --config 'profile.test.package.darner-shader.opt-level=3' test --workspace --locked --no-fail-fast (the opt-level only speeds up darner-shader's exhaustive float tests): 66 failed, all of which fail on unmodified main (c8258f9556) on this PC too (darner-shader tests that need Shader Model 6.6).
    • darner-gpu's test process aborts at the first test that needs Shader Model 6.6, on main too, so its tests were run in batches that survive the abort and compared one by one with main (main: 1658 pass, 8 fail, 139 need Shader Model 6.6, 81 ignored): no test that passes on main fails here, none removed; 73 new tests: 30 ignored, 43 pass.
    • cargo xtask policy: ok on the PR 8 head, which contains this branch.
    • Not run: tests that need Shader Model 6.6 or a GPU, and the strict-WARP tests behind the diagnostics/gpu-validation features.
  • Changes a default: yes, two, for darner play on every card: GPU-written mips are preserved, and heat haze runs without frame generation.
  • A/B result: none on Darner. The original heat-haze change records checks on an RTX 4080 at 4K, DLSS Balanced, no frame generation (the waterfront, and character silhouettes against glass), with no frame times. The mip change's first commit says "pending game validation". The commit that turns it on for play notes it was "reproduced on WARP; strict and normal 4K checks 209/210 kept scenery intact" (VIctory branch), again with no frame times.
  • Gates run on that revision: see above.
  • Gameplay: not run on Darner.
  • Hardware dependence: heat haze was only looked at on an RTX 4080. AMD and Intel are untested.
  • Coverage gaps: no in-game run. Both default changes need an A/B and a visual check on Darner before merging, per CONTRIBUTING.

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only). Not run in the game on Darner.
  • This PR contains one change based on main. No: three rendering changes plus tests, stacked on the PRs below.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: #282 (DARNER_ALIAS_DIRECT on by default; this PR leaves that switch to it and touches neighbouring code in texture.rs), #50 (refresh only CPU-written mips of BC textures: a different problem in the same file).
  • Replaces or overlaps: none found
**Not run in the game on Darner.** Ported from a local VIctory-NVIDIA branch (before the rename). The game checks quoted below were made on that branch, not on this port. ## Contributor role (optional) - Fluxer ID: ## What it changes - The problem on main: (1) a CPU refresh of a texture can overwrite mip levels the GPU copied into it earlier in submission order. (2) `darner play` leaves the heat-haze pass out entirely, together with face relocation. Six commits: - Preserve copied texture mips in submission order while refreshing untouched levels - Enable validated GPU-written mip preservation for normal play - Validate hot-page coherence and lifetime on software and RTX adapters - rendering: restore heat haze with the native early-depth correction - gpu: guard alias copy layouts and support controlled direct-copy comparisons - diagnostics: observe alias-copy overlap with write-capable bindings - `DARNER_GPU_WRITTEN_MIPS=1`: per-subresource ownership (after lobomfz/VIctory-xmem 2039e43). Levels the GPU wrote earlier in submission order are kept, and untouched levels are still refreshed. Atlas and external-write protection stay conservative. Masks are captured before parallel preludes, and this is merged with main's texture hoisting. **`darner play` sets it to 1.** - Heat haze: **`darner play` and `build-darner.ps1` now leave out only face relocation (`02384a60fda6f2d0`).** The heat-haze compute (`731a39171b568298`) runs, but the pipeline policy withholds it whenever `DARNER_EARLY_DEPTH` is off, since it needs the native early-depth correction. With frame generation on or made ready, both stay left out as before. An explicit `DARNER_LEAVE_OUT` still wins. The F1 row has three values, with new en and zh-CN strings. - Alias copies: layouts are checked against the textures before reuse, and direct texture-to-texture copies can be compared in a controlled way (`DARNER_ALIAS_PROFILE`, `DARNER_ALIAS_OVERLAP` diagnostics). `DARNER_ALIAS_DIRECT` stays off here: turning it on by default is #282's change. - Hot-page coherence and lifetime tests (software adapter, plus an RTX run when `DARNER_TILED_TEST_HARDWARE=1`). Declared view ranges are labelled as estimates. ## How it was tested - Tested revision: `58c3be48ea` - Commands and results: on `58c3be48ea` (this branch's head), Windows 10 22H2 with its built-in Direct3D 12 (no Shader Model 6.6), Rust 1.98.1: - `cargo clippy --workspace --all-targets --locked -- -D warnings`: passed - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: passed - `cargo --config 'profile.test.package.darner-shader.opt-level=3' test --workspace --locked --no-fail-fast` (the opt-level only speeds up darner-shader's exhaustive float tests): 66 failed, all of which fail on unmodified `main` (c8258f9556) on this PC too (darner-shader tests that need Shader Model 6.6). - darner-gpu's test process aborts at the first test that needs Shader Model 6.6, on `main` too, so its tests were run in batches that survive the abort and compared one by one with `main` (`main`: 1658 pass, 8 fail, 139 need Shader Model 6.6, 81 ignored): no test that passes on `main` fails here, none removed; 73 new tests: 30 ignored, 43 pass. - `cargo xtask policy`: ok on the PR 8 head, which contains this branch. - Not run: tests that need Shader Model 6.6 or a GPU, and the strict-WARP tests behind the diagnostics/gpu-validation features. - Changes a default: yes, two, for `darner play` on every card: GPU-written mips are preserved, and heat haze runs without frame generation. - A/B result: **none on Darner.** The original heat-haze change records checks on an RTX 4080 at 4K, DLSS Balanced, no frame generation (the waterfront, and character silhouettes against glass), with no frame times. The mip change's first commit says "pending game validation". The commit that turns it on for play notes it was "reproduced on WARP; strict and normal 4K checks 209/210 kept scenery intact" (VIctory branch), again with no frame times. - Gates run on that revision: see above. - Gameplay: not run on Darner. - Hardware dependence: heat haze was only looked at on an RTX 4080. AMD and Intel are untested. - Coverage gaps: no in-game run. Both default changes need an A/B and a visual check on Darner before merging, per CONTRIBUTING. ## Checklist - [ ] I ran this change in the game, or say below why it can't be (docs, tests only). **Not run in the game on Darner.** - [ ] This PR contains one change based on `main`. **No:** three rendering changes plus tests, stacked on the PRs below. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on #599 (stacked branch; contains #594, #596, #597 and #598) ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: #282 (`DARNER_ALIAS_DIRECT` on by default; this PR leaves that switch to it and touches neighbouring code in `texture.rs`), #50 (refresh only CPU-written mips of BC textures: a different problem in the same file). - Replaces or overlaps: none found
Ported to Darner from VIctory-NVIDIA b1443849.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refuse unsupported strict/software requests, retain bounded validation history, and guard host queue submissions. Preserve removal reports in a dedicated module. Add software-only regressions and optional link-time Agility declarations for tests.

Ported to Darner from VIctory-NVIDIA 3f156266.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Rebuild per-recording caches at both cut sites while retaining descriptor ownership. The current-renderer WARP regression read recycled 0xdeadbeef data before the fix and the expected constants after it; same-part and internal-pass reuse remain intact.

Ported to Darner from VIctory-NVIDIA 615e070f.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep current size classes and retention accounting while checking rounding and CPU-visible limits. Cap mapped-VRAM staging and avoid oversized spare reuse. Optional one-pass predictions outside the limit fall back to ordinary staging; six focused CPU checks pass.

Ported to Darner from VIctory-NVIDIA f7f0f1ec.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reconcile the legacy transition repair with the current memory wrappers and enhanced barriers. Strict WARP catches the previous invalid COPY_DEST-to-CBV use before submission. Constant, texture-source, cross-buffer and overlapping-copy regressions pass with legacy and enhanced barriers.

Ported to Darner from VIctory-NVIDIA 0e7a5c71.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Route relay fetches, card fetches and settling through the existing checked host wait. CPU regressions reject failed waits, incomplete fences and device-removal sentinels; a strict WARP copy/readback check still passes.

Ported to Darner from VIctory-NVIDIA bb4da85e.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The current compiled root signature omitted DATA_VOLATILE. A software regression checks that contract and reads both successive synthetic depth values through the same bound descriptor.

Ported to Darner from VIctory-NVIDIA 838504a0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep readonly depth plus shader-read states legal across views and avoid narrowing an already-compatible state. Preserve alias/read-watch observers and exact transitions for writes and COMMON. The WARP fixture goes from two tracked transitions to none; it and the CPU state checks pass. No game FPS result asserted.

Ported to Darner from VIctory-NVIDIA a04c61e1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The first guarded rework run stopped on 1024 stored cache-miss warnings rather than a GPU error. Filter only nonfatal severities in strict storage while retaining bounded, persistent errors and corruption. Software tests cover 6144 nonfatal messages followed by both fatal severities, real overflow, repeated refusal and concurrent reporting.

Ported to Darner from VIctory-NVIDIA 651f2399.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA 3c6511be.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA fae572a0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA eaee9c79.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA af64880d.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reuse the previously verified pose implementation and background desktop/audio setup. Restore optional frame captures and their output policy, guarded process supervision, and benchmark analysis. Keep normal play opt-in and all artifacts outside source. Pose, capture, desktop-refusal, analyzer and CPU-only watchdog checks pass.

Ported to Darner from VIctory-NVIDIA 90df996f.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA 0493d6cb.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA e744607a.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA 49ce022d.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA 42aa3f0f.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA 4dee6a3b.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA 6edfc508.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA fc34fb12.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA 32f7ae60.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA e7d26434.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adapted from lobomfz/VIctory-xmem fd19a20614b5e080b4bf6211ac5b7ebda682afc9 by lucalocastro. Preserve the existing alias-aware passes and default 447; add bit 512 with CPU graph and strict software DXIL execution coverage.

Ported to Darner from VIctory-NVIDIA fb5a0c84.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep guarded reads and zero-trip paths unchanged, reject every loop write, barrier, unknown effect and volatile read, and preserve the existing 447 defaults. Cover control-flow placement and exact software-rendered output; no frame-rate gain claimed.

Ported to Darner from VIctory-NVIDIA c56196e2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA b194f581.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA f1d91c6e.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Per-binding timestamps substantially disturbed the measured frame. Restore hashed optional sampling, retain fractional time in nanoseconds and preserve sample weights through query resolution. Whole-list and class timings remain unsampled. CPU selection/accounting and actual WARP query resolution pass. Escape existing synthetic fixture control bytes without changing their values.

Ported to Darner from VIctory-NVIDIA 2b101942.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Avoid per-list timestamp and resolve commands unless requested. Diagnostic builds retain timing by default; explicit zero overrides profiling requests. Software checks cover ordinary rendering without timing and requested sampled query resolution. Unavailable benchmark timing columns remain empty; the measured 20.6 FPS trial is preliminary, not the performance target.

Ported to Darner from VIctory-NVIDIA 221418ef.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA 36a0340c.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA 9bf82ffe.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA a7c1b507.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA 18d50d22.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA 631af449.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep profiling opt-in and read-only. Retain eight slow updates per path with cached copy metadata, separate elapsed sums by update type, and test bounded concurrent collection plus the disabled metadata contract. No allocation, copy, ordering or graphics-policy change.

Ported to Darner from VIctory-NVIDIA 3e34f76e.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA b195d4d6.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA 43586387.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA 37b1ea40.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA 88f4b130.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA 2995305f.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adapt the per-subresource ownership approach from lobomfz/VIctory-xmem 2039e43. Keep conservative atlas/external-write protection, capture masks before parallel preludes, and validate same-list, reordered, abandoned and array writes on strict WARP. Opt in with DARNER_GPU_WRITTEN_MIPS=1 pending game validation.

Ported to Darner from VIctory-NVIDIA 62d2715d.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA 1cd08bc4.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cover promotions, partial writes, demotions, shader-write handoff and real renderer copy-back. Keep original hardware benchmark guards. Label declared view ranges as estimates and remove unmeasured GPU-time-saving claims.

Ported to Darner from VIctory-NVIDIA cfe12bd3.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA ea3d9903.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA 08edbb2e.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported to Darner from VIctory-NVIDIA be64612e.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
TrustNo1 changed title from WIP: [pr-fix][rendering] GPU-written texture mips kept, heat haze back with early depth, alias copy layout guard, hot-page tests to WIP: GPU-written texture mips kept, heat haze back with early depth, alias copy layout guard, hot-page tests 2026-12-06 03:26:33 +00:00
This pull request has changes conflicting with the target branch.
  • crates/darner-game/src/lib.rs
  • crates/darner-gpu/src/cardmeter.rs
  • crates/darner-gpu/src/draw.rs
  • crates/darner-gpu/src/gpu_owned.rs
  • crates/darner-gpu/src/host.rs
  • crates/darner-gpu/src/host/bus.rs
  • crates/darner-gpu/src/host/upq.rs
  • crates/darner-shader/src/emit/mod.rs
  • docs/README-nvidia.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'pr/7-texture-mips-heat-haze-alias-copies:deama-pr/7-texture-mips-heat-haze-alias-copies'
git switch 'deama-pr/7-texture-mips-heat-haze-alias-copies'

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.

git switch 'Main'
git merge --no-ff 'deama-pr/7-texture-mips-heat-haze-alias-copies'
git switch 'deama-pr/7-texture-mips-heat-haze-alias-copies'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'deama-pr/7-texture-mips-heat-haze-alias-copies'
git switch 'deama-pr/7-texture-mips-heat-haze-alias-copies'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'deama-pr/7-texture-mips-heat-haze-alias-copies'
git switch 'Main'
git merge --squash 'deama-pr/7-texture-mips-heat-haze-alias-copies'
git switch 'Main'
git merge --ff-only 'deama-pr/7-texture-mips-heat-haze-alias-copies'
git switch 'Main'
git merge 'deama-pr/7-texture-mips-heat-haze-alias-copies'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!600
No description provided.