The sweep lets go placed host copies whose title memory is unmapped #1348
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1348
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1348"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@HailLucifer666 on GitHub · 2026-11-28 17:42 UTC · original
HailLucifer666:port/unmapped-placed-eviction→main· +2959 −23 · 18 files · 6 commits · openThe census counts a state nothing acts on: placed textures the title fills whose title memory is not mapped any more (
resource.rscount[8], sampled every 16th because asking Windows about all of them takes too long). Such a copy's source is gone — it can never be refreshed from title memory — so past its last use it is pure VRAM waste, which the reports show the cost of: #453 (graphics memory full within a minute, 29→<10 fps over 30 min), #609 (3,072 MB kept for render targets never given back on an 8 GB card).The mechanism
title_memory_unmappingrecords the range in O(1) (resource::unmapped);title_memory_remappedclears ranges it covers; the sweep drains the record and, for a placed texture overlapping it, applies the census's own idle window for that exact state (30 s / 60 frames —UNMAPPED_IDLE_MS/UNMAPPED_IDLE_FRAMES, one constant now shared by the census's count and the sweep's gate) instead of the VRAM-pressure line, which can be minutes.host_wrotetextures keep their existing skip (conservative: fewer evictions, never more). The per-sweep byte budget still bounds work; unmapped copies compete under it and continue over successive looks.title_memory_unmapping's walk and adds no per-texture Windows query to the sweep (the census samples every 16th for exactly that cost).Tests and probes (
resource::tests, 24 → part of victory-gpu's 458 passed / 0 failed / 36 ignored, clippy--all-targets --all-features -D warningsclean):overlap_any_is_half_open_on_both_ends— half-open boundaries, containment, zero-length, and the top-of-space saturation (my own first assertion there was wrong; the arithmetic was right — the test was corrected, noted here).the_unmapped_record_is_bounded_oldest_first— with the sweep off, the record ages out instead of growing without end.the_idle_gate_borrows_the_census_window_only_for_an_unmapped_source— mutation probes run and recorded: the unmapped arm disabled → red; the overlap boundary flipped → red. Restored byte-identical.the_unmapped_window_is_the_census_window— one constant, two readers, pinned.Stacks on #1290/#1294/#1326 for CI. The behavior claim that remains unproven is the in-game one (no machine here runs the title): what this PR provably does is make the sweep act on a state the census already measures, under the census's own safety window, with the sweep's own liveness gates unchanged.
THE BUG. Three classes, all found on main today: (1) the GPU tests silently report as passed on any machine without a WARP adapter -- WarpHarness::new() returns an Option and every acquire site does `let Some(...) = ... else { return }` (indirect.rs around 894, 970, 1025 and more), so the suite's green says nothing about whether the GPU tests executed; (2) cargo reports a filter that matched no test as exit 0, so a narrowed command reads as a pass; (3) a workflow file GitHub cannot load produces no run at all, and nothing in CI reads ci.yml itself before GitHub does. The pre-commit hook was also committed 100644, which makes every POSIX clone skip it in silence (found with git ls-tree; the same defect the Marvisak line shipped and fixed). THE FIX. Port the checks our Marvisak PR #2854 lineage shipped there: `cargo xtask test-gate` counts what each test binary announced (running N tests) against what it reported (test result: ...), refuses a run that executed nothing, refuses reports it cannot attribute to a binary cargo named, and parses CI's colored output; `cargo xtask workflows` shape-checks every file under .github/workflows, including duplicate keys (yaml-rust2 keeps the later value; GitHub refuses the document outright) and typechanged entries; policy --staged now fails closed on a staged entry the index cannot serve (a gitlink, an unspellable name) instead of skipping it; the hook runs both checks and its skip message names both; the hook is committed 100755; CI builds first and runs the gated binaries after, so a red run cannot hide behind a compile. WHY NOT HYPOTHETICAL. Main is red right now (issue #1267) precisely because the suite's own account was unreadable; on our Marvisak twin the same tooling refused a green-but-empty run in CI and caught a lost hook mode a green run missed. SCOPE. The WARP skip is made loud in a follow-up, not here: turning skips into panics before we know whether CI's runner has a WARP adapter could turn CI red on machines that were honestly skipping. The first CI run of this PR answers that question. The gate parses cargo's output shapes as they exist today; a --format json run is refused rather than guessed at. PROVENANCE. Ported from our Marvisak/VIctory PR #2854 branch (staging-bounds and pipeline-library fixes from the same line landed upstream as #1658/#1660); carries that branch's second-review fixes: policy --staged fails closed like its sibling, duplicate keys are refused, typechanged staged entries are listed, and the hook's skip message names both checks.c5ba3cb166to8b546b5b37@gut0to on GitHub · 2026-12-01 14:43 UTC · original · reviewed
AI-assisted review; I used an AI assistant to inspect this diff.
@ -2308,0 +2341,4 @@}let (start, end) = (at, at.saturating_add(len));let mut ranges = UNMAPPED.lock().unwrap_or_else(|e| e.into_inner());ranges.retain(|&(r, r_end)| !overlap_any(r, r_end - r, &[(start, end)]));@gut0to on GitHub · 2026-12-01 14:43 UTC · original
This drops an entire recorded interval on any overlap, but
XMemMapPhysicalPagescan remap only part of a previously unmapped range. For example, after unmapping[0, 64 KiB), remapping[16, 32 KiB)should leave the prefix and suffix recorded; removing the whole interval makes the next texture sweep miss those still-unmapped pages and retain their placed copies as if the source were mapped. Could you subtract the remapped interval and preserve the remaining pieces, with a middle-range remap test? AI-assisted review; I traced the map notification and sweep bookkeeping.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.Merge
Merge the changes and update on Forgejo.