Add opt-in copy-stale page-walk counters #4803

Closed
github-bot wants to merge 1 commit from github-bot/gh-4802 into main AGit
Owner

@⁠john-9474 on GitHub · 2026-12-01 09:19 UTC · original
john-9474:codex/copy-stale-work-profile → main · +406 −0 · 4 files · 1 commits · closed without merging

What it changes

Refresh/check request spans and reported copy results do not show how much work reaches the original Shadow::copy_stale page loop. Add diagnostics-only, default-off VICTORY_COPY_STALE_PROFILE=1 counters to measure that denominator before choosing an optimisation.

The existing five-second report gains 13 cumulative fields: completed walks, queried pages, supplied/consumed journal entries, planned stale pages/bytes, slot-eligible walks/pages/stale pages, potential newer-journal epoch reads, and unknown/memo-only/journal-contract fallbacks. A stack capture follows the original decisions and updates one of 16 fixed counter banks after planning; it adds no per-page atomics or lifetime registry. The original bypasses, planner, copies, stamps, guards and fences are preserved.

Fields are independent snapshots. Saturation is explicit; exact deltas must be discarded once saturated. Planned bytes precede sub-page filtering and copying. Newer-journal counts are potential epoch reads among eligible pages, not journal sparsity, physical traffic, elapsed time or time saved. This PR changes no copying policy.

In a separate private release-equivalent integration run using the same observer and byte-identical original copy_stale body, the supplied journal was dense even though the newer-epoch subset was small. That rejected a naive sparse-journal premise. This is diagnostic usefulness, not clean-PR application validation or a performance/zero-overhead claim. No runtime instrumentation parent or analysis script is included here.

How it was tested

Clean four-file patch on 5fabb46eaf6ed8771321787f8871051abde69b9b; Rust 1.98.1, --locked, two jobs. Cargo.lock is unchanged.

  • Default and diagnostics victory-gpu --all-targets checks passed; release diagnostics libtest compiled with opt3/LTO-off/16 codegen units for correctness testing.
  • Five counter-model cases passed. An ignored fresh-process CPU test drove the actual production banks with 40 colliding writers and checked all 13 joined totals, individual-bank saturation and cross-bank snapshot overflow.
  • The same clean libtest binary (161513f975ea44a9ce262524748bad08bdbab3022fa0f17884a22a56fe894dfe) passed three fresh-process owned mapped-Shadow cases, observer OFF/ON/OFF: 786,432 bytes checked each, 2,359,296 total. Actual Windows write-watch drove four original walks; checks covered untouched partial borders, unchanged ranges, a real changed byte and published page stamps. All native children and outer guards exited 0.
  • The owned case requires an actual NVIDIA Host adapter, active D3D12 InfoQueue and clean boundary drains. It submits no GPU commands: these results do not validate GPU copies, aliases, SEND or merge behaviour, nor provide a drain-independent callback witness. Series profile, resolution, DLSS/frame generation and shader wave size do not apply to these CPU-copy component tests.
  • Both strict default/diagnostics GPU all-target Clippy commands fail on the same five unchanged UI diagnostics: font.rs 213/260, menu.rs 667 and panel.rs 602/668. Those three files match clean main byte-for-byte and the existing clean-main CI findings. No authored diagnostic was reported; no lint allowance or unrelated UI repair was added. This is not a full CI pass.
  • Dedicated correct-tree cargo run --locked --quiet --jobs 2 -p xtask -- policy --staged passed for exactly four files; diff check passed. Full workspace tests were not run.

The two rig/process-specific tests remain ignored by ordinary CI. Their ignore reasons document the fresh-process and environment requirements.

Checked for overlap

  • Targeted open/closed PR and issue searches covered copy_stale, page walks, counters, profiling, journal census and the new field/flag names. This was a bounded search, not an exhaustive repository-wide absence claim.
  • Complements #4222: request/check coverage is not the original loop's queried-page/eligible/newer-journal denominator.
  • Reviewed related source in #4295 (empty-journal bypass), #2049 (sparse planner), #4775 (pre-queue no-op sift), #4341 (card-retake diagnostics/policy), #3650 and #614 (broader refresh/copy work). Their current heads match the pinned source review; no matching 13-field original-loop observer was found in that scope. Merged #2530 changes hot-path bookkeeping; this patch observes main's current loop without reverting it.
  • Four files only; no production optimisation, private renderer/state engine, dependencies, assets or captured title data.
**@⁠john-9474** on GitHub · 2026-12-01 09:19 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4802) `john-9474:codex/copy-stale-work-profile` → `main` · +406 −0 · 4 files · 1 commits · closed without merging ## What it changes Refresh/check request spans and reported copy results do not show how much work reaches the original `Shadow::copy_stale` page loop. Add diagnostics-only, default-off `VICTORY_COPY_STALE_PROFILE=1` counters to measure that denominator before choosing an optimisation. The existing five-second report gains 13 cumulative fields: completed walks, queried pages, supplied/consumed journal entries, planned stale pages/bytes, slot-eligible walks/pages/stale pages, potential newer-journal epoch reads, and unknown/memo-only/journal-contract fallbacks. A stack capture follows the original decisions and updates one of 16 fixed counter banks after planning; it adds no per-page atomics or lifetime registry. The original bypasses, planner, copies, stamps, guards and fences are preserved. Fields are independent snapshots. Saturation is explicit; exact deltas must be discarded once saturated. Planned bytes precede sub-page filtering and copying. Newer-journal counts are potential epoch reads among eligible pages, not journal sparsity, physical traffic, elapsed time or time saved. This PR changes no copying policy. In a separate private release-equivalent integration run using the same observer and byte-identical original `copy_stale` body, the supplied journal was dense even though the newer-epoch subset was small. That rejected a naive sparse-journal premise. This is diagnostic usefulness, not clean-PR application validation or a performance/zero-overhead claim. No runtime instrumentation parent or analysis script is included here. ## How it was tested Clean four-file patch on `5fabb46eaf6ed8771321787f8871051abde69b9b`; Rust 1.98.1, `--locked`, two jobs. Cargo.lock is unchanged. - Default and diagnostics `victory-gpu --all-targets` checks passed; release diagnostics libtest compiled with opt3/LTO-off/16 codegen units for correctness testing. - Five counter-model cases passed. An ignored fresh-process CPU test drove the actual production banks with 40 colliding writers and checked all 13 joined totals, individual-bank saturation and cross-bank snapshot overflow. - The same clean libtest binary (`161513f975ea44a9ce262524748bad08bdbab3022fa0f17884a22a56fe894dfe`) passed three fresh-process owned mapped-Shadow cases, observer OFF/ON/OFF: 786,432 bytes checked each, 2,359,296 total. Actual Windows write-watch drove four original walks; checks covered untouched partial borders, unchanged ranges, a real changed byte and published page stamps. All native children and outer guards exited 0. - The owned case requires an actual NVIDIA Host adapter, active D3D12 InfoQueue and clean boundary drains. It submits no GPU commands: these results do not validate GPU copies, aliases, SEND or merge behaviour, nor provide a drain-independent callback witness. Series profile, resolution, DLSS/frame generation and shader wave size do not apply to these CPU-copy component tests. - Both strict default/diagnostics GPU all-target Clippy commands fail on the same five unchanged UI diagnostics: `font.rs` 213/260, `menu.rs` 667 and `panel.rs` 602/668. Those three files match clean main byte-for-byte and the [existing clean-main CI findings](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46553617760/job/142323033705). No authored diagnostic was reported; no lint allowance or unrelated UI repair was added. This is not a full CI pass. - Dedicated correct-tree `cargo run --locked --quiet --jobs 2 -p xtask -- policy --staged` passed for exactly four files; diff check passed. Full workspace tests were not run. The two rig/process-specific tests remain ignored by ordinary CI. Their ignore reasons document the fresh-process and environment requirements. ## Checked for overlap - [x] Targeted open/closed PR and issue searches covered `copy_stale`, page walks, counters, profiling, journal census and the new field/flag names. This was a bounded search, not an exhaustive repository-wide absence claim. - Complements #4222: request/check coverage is not the original loop's queried-page/eligible/newer-journal denominator. - Reviewed related source in #4295 (empty-journal bypass), #2049 (sparse planner), #4775 (pre-queue no-op sift), #4341 (card-retake diagnostics/policy), #3650 and #614 (broader refresh/copy work). Their current heads match the pinned source review; no matching 13-field original-loop observer was found in that scope. Merged #2530 changes hot-path bookkeeping; this patch observes main's current loop without reverting it. - Four files only; no production optimisation, private renderer/state engine, dependencies, assets or captured title data.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 09:21:35 +00:00
github-bot closed this pull request 2026-12-01 18:36:31 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:31 UTC · original

Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:31 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4802#issuecomment-7321095786) Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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
github/trustno1-coder--VIctory-NVIDIA!4803
No description provided.