Repository navigation
Conversation
Use the active entry or retention thresholds for both the pressure decision and its physical-only diagnostic. Cover commit-only retention and exact boundaries with synthetic regression tests.
|
Verified the physical-only counter on native Windows across full pressure transitions on base
The base overcounted physical-only pressure by 90 in this synthetic sequence. Both trees matched the expected pressure flag, instantaneous headroom, low-water marks, and pressure/critical counts after every successful sample. After each of 648 injected failed reads, the pressure flag, sample count and physical-only count stayed unchanged. I found the old wording in historical findings but no other tracked literal consumer of that wording. This verifies attribution without inducing real memory pressure. Claim in #2570. AI-assisted with OpenAI Codex (GPT-6). |
|
Thanks for running the Windows replay through |
KelboLive
left a comment
There was a problem hiding this comment.
Direction is right: next_pressure (residency.rs:180-190) fixes the 6 GiB free / 5 GiB commit mislabel, and using only .0 at :198 leaves admission behaviour unchanged — the boolean itself is the same expression, so this is attribution only.
Two things to adjust:
- The retention thresholds undercount severe physical pressure. Because
physical_onlyuses the retention pair,physical = 1 GiBwithcommit = 5.9 GiBis labelled not physical-only — which is exactly the low-RAM shape indocs/findings.md:716("360–390 MB free … while 5.9 to 7.0 GB are left to commit"). It also means identical(physical, commit)samples are labelled differently on the entry sample vs later ones, and the label flips at exactly 6 GiB. Consider reporting physical-only / commit-only / both, or attributing against the entry thresholds, so the severe-physical case is not hidden. - The counter wiring is untested. Changing
if physical_onlytoif false && physical_only(:202) leaves all four residency tests green — the new test covers only the pure predicate. Arefresh()-level assertion (or a seam for the sample) would pin it.
Sampling note: 1 Hz is fine for prevalence over minutes, but these counts are sample-seconds, not pressure episodes, and sub-second spikes are invisible; refresh() also samples commit directly while critical_commit() uses the 32 ms cache, so the two readings can disagree slightly. Worth a sentence in the body.
pipeline::/crate suite is 645/0/59 (the two diagnostics failures under --features diagnostics are the known parallel flakes, green alone). Merge with current main is clean, and #2929/#2658/#2765 are file-disjoint — host RAM/commit attribution vs adapter VRAM budgets, so no double counting.
|
Thanks for pointing out the 1 GiB / 5.9 GiB case and the unchecked counter write. Commit |
Claimed in the coordination issue as: D3D12-RESIDENCY-PRESSURE-ATTRIBUTION
What and why
The physical-only counter used the fixed 4 GiB commit entry threshold to attribute every pressured sample. A host that is already under pressure and has 6 GiB free physical memory and 5 GiB commit headroom stays under pressure due to commit. The old diagnostic counted that sample as physical-only.
Derive the pressure decision and the three diagnostic counts from the same physical and commit constraints. Entry still uses inclusive 3 GiB physical and 4 GiB commit thresholds. Retention still applies below 5 GiB physical or below 6 GiB commit. Each pressured sample now records one of three categories under the active thresholds: physical only, commit only, or both. For example, 1 GiB of free physical memory and 5.9 GiB of commit headroom counts as physical only at entry and as both during retention, making the physical constraint visible in both samples. The change is limited to attribution and its log wording. Admission decisions and memory budgets retain their original behavior.
Counts describe successful samples taken roughly once per second. Shorter spikes can fall between samples. The sweep reads commit headroom directly, and the separate critical-commit query uses a 32 ms cache and also considers recent allocation failures.
Tested
Red. Ran
cargo test -p leonida-gpu --lib --locked residency::tests::physical_only_pressure_uses_the_active_thresholds -- --exactafter a behavior-preserving extraction of the original predicate. Exit 101. The assertion for 6 GiB free RAM and 5 GiB commit headroom sawphysical_only=true, withfalseexpected.Green. All four residency tests passed with default features and with
diagnostics. The regression covers entry and retention, both constraints, physical-only and commit-only pressure, recovery, and single-byte boundaries. Existing admission and prefetch tests also pass.cargo build --workspace --all-targets --lockedpassed. The original workspace regression run used--no-fail-fast, excludedxtask, and applied the documenteddepth_bounds_pipeline_loads_and_filters_drawsskip. Theleonida-gpuunit suite passed 644 tests.On the synchronized branch,
leonida-gpupassed 644 unit tests with the same depth-bounds skip (59 ignored). The four residency tests also passed again withdiagnostics.Five pre-existing workspace failures. All reproduced on clean upstream
1e3e316c5e7b072bc26a3e3ce78950b9fde84a43, the base of the original workspace run.settings_line::a_run_logs_the_settings_it_starts_withfailed with inheritedRUST_LOG=warn. It passed on both revisions withRUST_LOGunset for the test process.emit::barycentric_tests::a_masked_pixel_program_reads_the_position_where_the_vertex_program_writes_itemit::barycentric_tests::first_half_values_render_on_hardware_and_warpemit::rect::tests::rectangles_are_drawn_wholeemit::rect::tests::the_rectangle_stage_is_a_geometry_shaderThe four
leonida-shadertests failed DXIL validation on both revisions withContainer part 'Pipeline State Validation' does not match expected for module.cargo test -p leonida-gpu --features diagnostics --test replay --locked -- --nocapturepassed again on the synchronized branch. The synthetic D3D12 fixture recorded and replayed a frame with identical picture hashes.All 24 game-gate Python tests passed.
git diff --checkand the repository-widepython -I scripts/check_no_game_data.pypassed. An independent read-only review found no blocking issues.Review follow-up
26da88e8tested the counter update used byrefresh()on a synthetic sample sequence. A mutation that recorded a physical-only sample as mixed made the new test fail. All four targeted tests passed with and withoutdiagnosticsafter restoring the counter. This includes the reported low-RAM example, both hysteresis states and recovery.The follow-up replay passed, and the 644-test GPU suite passed in both parallel and serial reruns with the same depth-bounds skip. The initial parallel follow-up run had two intermittent failures in unrelated descriptor and alias-cast tests. The reruns and a parallel run of the previously published head passed both cases.
GPUs tested: Windows 11 Pro x64 build 26200 host with an NVIDIA GeForce RTX 4070 SUPER and driver 621.40. Synthetic replay uses the default D3D12 adapter. The residency regression runs on the CPU. The tested scope is diagnostic attribution.
AI-assisted: Yes. GPT-6.2 Sol (
gpt-6.2-sol) implemented and tested the change. GPT-6.2 Astra (gpt-6.2-astra) performed the independent read-only review.Checklist
mainat1fff69129529c2f45d2e8f7524278ecefe291e0cand merges cleanly.