Report memory placement on the five-second clock #489

Open
superhero-520 wants to merge 1 commit from superhero-520/Darner:fix-placement-ledger-cadence into Main
Contributor

Contributor role (optional)

superhero-520

What it changes

The placement ledger was checking the time since the last one-second frame report. Each check reset its timestamp. A steady stream of reports could therefore suppress the ledger indefinitely. This change runs the ledger alongside the existing five-second memory reports.

One archived session had 2,927 frame-time reports, 587 five-second texture-queue reports and two placement reports. Both placement reports followed gaps of more than five seconds. A 174 MiB graphics heap twin was present in both. The exact build of that archive is unknown.

How it was tested

  • Tested revision f0966e1 against its parent d91d8e4 on Windows with Rust 1.98.1.
  • A private native fixture called the production Meter::frame with a null window and no GPU device. On each revision it made 12 updates at 1.05-second intervals, waited 11.3 seconds, made three immediate calls, then resumed for five updates. Each reporting setting ran in a separate process. The candidate's host.rs matched the PR blob before the test fixture was appended.
Placement reports with DARNER_MEMORY_REPORT=1 Parent PR
First 12 updates 0 2
First update after the pause 1 1
Three immediate calls 0 0
Five subsequent updates 0 1

With DARNER_MEMORY_REPORT=0 both revisions emitted zero placement reports in every phase. The independent five-second marker fired four times per run.

  • cargo clippy --workspace --all-targets --locked -- -D warnings passed.
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings passed.
  • cargo test -p darner-gpu --lib --locked residency:: passed all 12 tests.
  • cargo run --locked --quiet --package xtask -- policy passed (564 files). git diff --check origin/main...HEAD passed.
  • cargo test --workspace --locked reported a failure in emit::waterfall_tests::sampled_marks_restore_early_depth_only_when_safe_in_pixel_shaders. Its fixture declares SV_Depth and the DXIL validator reports that the depth output was not fully written. The isolated test produced the same diagnostic on both this head and clean parent d91d8e4. Open PR #227 changes that fixture. The full run’s GPU library completed with 1,793 passed and 81 ignored. Separate runs of the remaining darner-simd and xtask targets and workspace doc tests passed. The local runner reached its 30-minute limit (exit 124) while the exhaustive oracle64::legacy_mul_forms_are_exact test was still running. A separate run of that unchanged test with profile.test.package.darner-shader.opt-level=3 passed in 82.89 seconds of test time.
  • The change affects a diagnostic's cadence. The test exercised the reporter with an absent device. Gameplay and physical GPU measurements were outside this run.

Checklist

  • Gameplay run on the proposed revision.
  • One change based on upstream main.
  • The diff follows the asset policy.
  • Dependencies recorded. Depends on none.

Checked for overlap

  • Checked open and closed issues and PRs and the 47 open PRs changing host.rs. None changed the placement clock.
  • Related work in the same frame reporter: #130 (build identifier), #319 and #332 (memory cleanup), #368 (log filtering). No replacement or dependency.
## Contributor role (optional) superhero-520 ## What it changes The placement ledger was checking the time since the last one-second frame report. Each check reset its timestamp. A steady stream of reports could therefore suppress the ledger indefinitely. This change runs the ledger alongside the existing five-second memory reports. One archived session had 2,927 frame-time reports, 587 five-second texture-queue reports and two placement reports. Both placement reports followed gaps of more than five seconds. A 174 MiB graphics heap twin was present in both. The exact build of that archive is unknown. ## How it was tested - Tested revision `f0966e1` against its parent `d91d8e4` on Windows with Rust 1.98.1. - A private native fixture called the production `Meter::frame` with a null window and no GPU device. On each revision it made 12 updates at 1.05-second intervals, waited 11.3 seconds, made three immediate calls, then resumed for five updates. Each reporting setting ran in a separate process. The candidate's `host.rs` matched the PR blob before the test fixture was appended. | Placement reports with `DARNER_MEMORY_REPORT=1` | Parent | PR | |---|---:|---:| | First 12 updates | 0 | 2 | | First update after the pause | 1 | 1 | | Three immediate calls | 0 | 0 | | Five subsequent updates | 0 | 1 | With `DARNER_MEMORY_REPORT=0` both revisions emitted zero placement reports in every phase. The independent five-second marker fired four times per run. - `cargo clippy --workspace --all-targets --locked -- -D warnings` passed. - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` passed. - `cargo test -p darner-gpu --lib --locked residency::` passed all 12 tests. - `cargo run --locked --quiet --package xtask -- policy` passed (564 files). `git diff --check origin/main...HEAD` passed. - `cargo test --workspace --locked` reported a failure in `emit::waterfall_tests::sampled_marks_restore_early_depth_only_when_safe_in_pixel_shaders`. Its fixture declares `SV_Depth` and the DXIL validator reports that the depth output was not fully written. The isolated test produced the same diagnostic on both this head and clean parent `d91d8e4`. Open PR #227 changes that fixture. The full run’s GPU library completed with 1,793 passed and 81 ignored. Separate runs of the remaining `darner-simd` and `xtask` targets and workspace doc tests passed. The local runner reached its 30-minute limit (exit 124) while the exhaustive `oracle64::legacy_mul_forms_are_exact` test was still running. A separate run of that unchanged test with `profile.test.package.darner-shader.opt-level=3` passed in 82.89 seconds of test time. - The change affects a diagnostic's cadence. The test exercised the reporter with an absent device. Gameplay and physical GPU measurements were outside this run. ## Checklist - [ ] Gameplay run on the proposed revision. - [x] One change based on upstream main. - [x] The diff follows the asset policy. - [x] Dependencies recorded. Depends on none. ## Checked for overlap - [x] Checked open and closed issues and PRs and the 47 open PRs changing `host.rs`. None changed the placement clock. - Related work in the same frame reporter: #130 (build identifier), #319 and #332 (memory cleanup), #368 (log filtering). No replacement or dependency.
superhero-520 changed title from WIP: [pr-fix][memory] Report memory placement on the five-second clock to [pr-fix][memory] Report memory placement on the five-second clock 2026-12-05 03:25:11 +00:00
First-time contributor

Tested merged on c8258f9 across 30,000+ frames on Series X (RTX 5070 Ti 16 GB, Core Ultra 7 265KF, 64 GB DDR5-6400):

  • Fired reliably 60 times on the 5-second clock with zero performance stalls. Sample end-of-run output: device-local 30621 (3768 MB), CPU-visible 1 (16 MB), staging 132 (4166 MB), readback 163 (33 MB), CPU-mapped VRAM 506 (3068 MB); directly backed copies: alive 2 windows 16 MB; graphics heap twin: 174 MiB; DXGI local 11982/14071 MB, shared 4518/48004 MB.
  • Directly helped us diagnose why DXGI shared RAM was growing and verify VRAM headroom improvements (see PR #528). Clean merge and clippy --all-features -D warnings pass.
Tested merged on `c8258f9` across 30,000+ frames on Series X (RTX 5070 Ti 16 GB, Core Ultra 7 265KF, 64 GB DDR5-6400): - Fired reliably 60 times on the 5-second clock with zero performance stalls. Sample end-of-run output: `device-local 30621 (3768 MB), CPU-visible 1 (16 MB), staging 132 (4166 MB), readback 163 (33 MB), CPU-mapped VRAM 506 (3068 MB); directly backed copies: alive 2 windows 16 MB; graphics heap twin: 174 MiB; DXGI local 11982/14071 MB, shared 4518/48004 MB`. - Directly helped us diagnose why DXGI shared RAM was growing and verify VRAM headroom improvements (see PR #528). Clean merge and `clippy --all-features -D warnings` pass.
TrustNo1 changed title from [pr-fix][memory] Report memory placement on the five-second clock to Report memory placement on the five-second clock 2026-12-06 03:28:04 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix-placement-ledger-cadence:superhero-520-fix-placement-ledger-cadence'
git switch 'superhero-520-fix-placement-ledger-cadence'

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 'superhero-520-fix-placement-ledger-cadence'
git switch 'superhero-520-fix-placement-ledger-cadence'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'superhero-520-fix-placement-ledger-cadence'
git switch 'superhero-520-fix-placement-ledger-cadence'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'superhero-520-fix-placement-ledger-cadence'
git switch 'Main'
git merge --squash 'superhero-520-fix-placement-ledger-cadence'
git switch 'Main'
git merge --ff-only 'superhero-520-fix-placement-ledger-cadence'
git switch 'Main'
git merge 'superhero-520-fix-placement-ledger-cadence'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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!489
No description provided.