Add bounded diagnostics-only refresh work census #4222

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

@⁠john-9474 on GitHub · 2026-11-30 17:34 UTC · original
john-9474:codex/bounded-refresh-work-census → main · +1063 −0 · 8 files · 1 commits · closed without merging

What it changes

Clean checks can skip Shadow::update entirely, so a positive-update census cannot show how often those paths run. This adds diagnostics-only VICTORY_COPY_WORK=1, off by default, to observe refresh requests, all three clean-check paths, update results and mirror-copy requests by existing Shadow lifetime ID.

The book retains metadata for the first 8,192 registered lifetimes, including retired records, and reports explicit cumulative coverage loss for later lifetimes and oversized batches. Events use cached per-copy atomic counters after registration; no Shadow, D3D resource or title bytes are retained. Reports show up to 12 changed interval rows at the existing frame-meter cadence, independently of VICTORY_PROCESS_MEMORY. Copies, readbacks, protections, fences, placement and ownership policy are unchanged.

With diagnostics compiled and the switch off, the dormant OnceLock field and cached flag branch remain; this is not a zero-overhead claim. Builds without diagnostics omit the hooks. Request bytes count repeated overlaps, update bytes are the existing method's result, and rows rank check counts rather than CPU time. None of these metrics establishes native CPU reads, GPU-only memory or ownership.

How it was tested

  • Refreshed on 7d93ee07: ten pure copywork::model tests passed (exact CPU-only filter), default and diagnostics GPU-library checks passed, and strict GPU-crate all-target Clippy passed in both configurations (cargo clippy --locked --jobs 2 -p victory-gpu --all-targets [--features diagnostics] -- -D warnings). Explicit locked staged policy passed for all eight files; Cargo.lock is unchanged. Ignored hardware-hook fixtures compiled but were not executed in this refresh.
  • Compared with published 44b58d5c, all census code, hooks and authored fixtures are byte-identical; only upstream's unused ranged and mb helper removals differ in the touched files. Native and overhead results below retain their original base/source scope; no new-main native/GPU run is claimed.

Original validation on release .02 main 84bd61e2:

  • Diagnostic GPU libtest and CLI builds passed with locked dependencies, opt3/LTO off/16 codegen units. Ten model tests passed. Current-source hardware correctness passed in fresh OFF/ON/OFF processes: all 128 KiB initial/edited/deferred GPU readbacks, all three clean paths under actual ask_once, enabled counter assertions, metadata retirement, dedicated logging with PROCESS_MEMORY=0, and active independent InfoQueue checks. The test callback context has bounded process lifetime; no unregister join/drain guarantee is assumed.
  • An actual native Series X diagnostic run emitted 13 reports. The last retained 7,191 lifetimes (including 1,278 retired), with no reported untracked lifetimes, saturation or batch overflow. Selected rows distinguished a 1 MiB window's 5,195 checks/4,566 clean results/1.77 MB update results from a 174 MiB lifetime's 8.89 GB update results. These are selected top-12 interval lower bounds, not whole-renderer or physical-traffic totals. The run ended at its existing 6 GiB commit-headroom guard.
  • At roughly 6,000–7,000 records, actual report elapsed time was about 0.7–0.99 ms, including its log sink. This is not total event overhead or an 8,192-record measurement.
  • Earlier, a different frozen diagnostics binary on c71899d9 measured enabled versus instrumented OFF warm checks: serial +13.94 ns (+32.4%), snapshot +14.05 ns (+40.0%), and batch +19.54 ns (+21.1%). The four-worker disjoint-copy difference was below OFF reversal drift. The docs preserve that workload, exact commands and limits; no gameplay FPS, current-release overhead, patched-OFF versus unpatched cost or performance improvement is claimed.
  • Fresh staged policy and diff checks passed for these eight files. Paired clean-control/candidate GPU-package Clippy checks, default and all features, reported identical existing findings and no added authored-path diagnostics. They do not pass overall: baseline Shadow::ranged dead code, host.rs manual-is-multiple-of, and diagnostics copystat::mb dead code remain. The full workspace suite was not run.

The final documentation revision changes no compiled source. Local mute/native sparse-file runtime helpers used for the native test are excluded, as are all game data, logs, binaries and dependency changes.

Checked for overlap

  • Overlap checked before the original publication and refreshed before updating: exact VICTORY_COPY_WORK/ShadowID searches, recent open census/refresh diagnostics, and the current related PR heads. #2960 already supplies broader per-buffer refresh/readback/timing probes; #3271 supplies the positive-update census (also present in this base). This is a narrower complementary tool with bounded lifetime metadata and clean-bypass coverage, not the first per-buffer census or a proven faster replacement. #3869 observes native resource/heap destruction lifetimes, a different scope. #4378 now adds per-frame chain timings and refreshed/send bytes classified by backing, which complements this lifetime book and clean-bypass coverage.

Historical CI on original head 44b58d5c stopped at default workspace Clippy. The PR job and clean 84bd job reported the same three unchanged baseline errors (loop_caps, ranged and manual-is-multiple-of); diagnostics and tests were skipped after that failure. Upstream #4297 has since addressed those baseline findings, including the unused diagnostics mb helper. The refreshed focused strict checks above pass without authored lint allowances or bundled baseline cleanup. New remote workspace CI remains separate from the local results.

**@⁠john-9474** on GitHub · 2026-11-30 17:34 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4221) `john-9474:codex/bounded-refresh-work-census` → `main` · +1063 −0 · 8 files · 1 commits · closed without merging ## What it changes Clean checks can skip `Shadow::update` entirely, so a positive-update census cannot show how often those paths run. This adds diagnostics-only `VICTORY_COPY_WORK=1`, off by default, to observe refresh requests, all three clean-check paths, update results and mirror-copy requests by existing Shadow lifetime ID. The book retains metadata for the first 8,192 registered lifetimes, including retired records, and reports explicit cumulative coverage loss for later lifetimes and oversized batches. Events use cached per-copy atomic counters after registration; no Shadow, D3D resource or title bytes are retained. Reports show up to 12 changed interval rows at the existing frame-meter cadence, independently of `VICTORY_PROCESS_MEMORY`. Copies, readbacks, protections, fences, placement and ownership policy are unchanged. With diagnostics compiled and the switch off, the dormant `OnceLock` field and cached flag branch remain; this is not a zero-overhead claim. Builds without diagnostics omit the hooks. Request bytes count repeated overlaps, update bytes are the existing method's result, and rows rank check counts rather than CPU time. None of these metrics establishes native CPU reads, GPU-only memory or ownership. ## How it was tested - Refreshed on `7d93ee07`: ten pure `copywork::model` tests passed (exact CPU-only filter), default and diagnostics GPU-library checks passed, and strict GPU-crate all-target Clippy passed in both configurations (`cargo clippy --locked --jobs 2 -p victory-gpu --all-targets [--features diagnostics] -- -D warnings`). Explicit locked staged policy passed for all eight files; Cargo.lock is unchanged. Ignored hardware-hook fixtures compiled but were not executed in this refresh. - Compared with published `44b58d5c`, all census code, hooks and authored fixtures are byte-identical; only upstream's unused `ranged` and `mb` helper removals differ in the touched files. Native and overhead results below retain their original base/source scope; no new-main native/GPU run is claimed. Original validation on release .02 main `84bd61e2`: - Diagnostic GPU libtest and CLI builds passed with locked dependencies, opt3/LTO off/16 codegen units. Ten model tests passed. Current-source hardware correctness passed in fresh OFF/ON/OFF processes: all 128 KiB initial/edited/deferred GPU readbacks, all three clean paths under actual `ask_once`, enabled counter assertions, metadata retirement, dedicated logging with `PROCESS_MEMORY=0`, and active independent InfoQueue checks. The test callback context has bounded process lifetime; no unregister join/drain guarantee is assumed. - An actual native Series X diagnostic run emitted 13 reports. The last retained 7,191 lifetimes (including 1,278 retired), with no reported untracked lifetimes, saturation or batch overflow. Selected rows distinguished a 1 MiB window's 5,195 checks/4,566 clean results/1.77 MB update results from a 174 MiB lifetime's 8.89 GB update results. These are selected top-12 interval lower bounds, not whole-renderer or physical-traffic totals. The run ended at its existing 6 GiB commit-headroom guard. - At roughly 6,000–7,000 records, actual report elapsed time was about 0.7–0.99 ms, including its log sink. This is not total event overhead or an 8,192-record measurement. - Earlier, a different frozen diagnostics binary on `c71899d9` measured enabled versus instrumented OFF warm checks: serial +13.94 ns (+32.4%), snapshot +14.05 ns (+40.0%), and batch +19.54 ns (+21.1%). The four-worker disjoint-copy difference was below OFF reversal drift. The docs preserve that workload, exact commands and limits; no gameplay FPS, current-release overhead, patched-OFF versus unpatched cost or performance improvement is claimed. - Fresh staged policy and diff checks passed for these eight files. Paired clean-control/candidate GPU-package Clippy checks, default and all features, reported identical existing findings and no added authored-path diagnostics. They do **not** pass overall: baseline `Shadow::ranged` dead code, `host.rs` manual-is-multiple-of, and diagnostics `copystat::mb` dead code remain. The full workspace suite was not run. The final documentation revision changes no compiled source. Local mute/native sparse-file runtime helpers used for the native test are excluded, as are all game data, logs, binaries and dependency changes. ## Checked for overlap - [x] Overlap checked before the original publication and refreshed before updating: exact `VICTORY_COPY_WORK`/`ShadowID` searches, recent open census/refresh diagnostics, and the current related PR heads. #2960 already supplies broader per-buffer refresh/readback/timing probes; #3271 supplies the positive-update census (also present in this base). This is a narrower complementary tool with bounded lifetime metadata and clean-bypass coverage, not the first per-buffer census or a proven faster replacement. #3869 observes native resource/heap destruction lifetimes, a different scope. #4378 now adds per-frame chain timings and refreshed/send bytes classified by backing, which complements this lifetime book and clean-bypass coverage. Historical CI on original head `44b58d5c` stopped at default workspace Clippy. The [PR job](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46474745829/job/142045770299) and [clean 84bd job](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46462292806/job/142001487347) reported the same three unchanged baseline errors (`loop_caps`, `ranged` and manual-is-multiple-of); diagnostics and tests were skipped after that failure. Upstream #4297 has since addressed those baseline findings, including the unused diagnostics `mb` helper. The refreshed focused strict checks above pass without authored lint allowances or bundled baseline cleanup. New remote workspace CI remains separate from the local results.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 18:08:54 +00:00
github-bot force-pushed github-bot/gh-4221 from 44b58d5c03 to 787ff23957 2026-12-01 00:17:53 +00:00 Compare
github-bot closed this pull request 2026-12-01 18:50:26 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:45 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:45 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4221#issuecomment-7321483037) 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!4222
No description provided.