Page residency: say which of the title's pages on the card the card is known to read #475
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!475
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-475"
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?
@LOCKhart07 on GitHub · 2026-12-04 15:36 UTC · original
LOCKhart07:main-residency-census→main· +341 −1 · 4 files · 2 commits · merged 2026-12-04 17:30 UTCTaken out of the reuse change of #374, where it rode along. It has nothing to do with hardware ray tracing and stands here on main alone. For the log only. No switch.
What it adds
The page residency line says how much paged title memory is on the card, not whether the card has any use for it there. A second line now sorts the pages on the card by what is known of the card's reads of them (marked as read, pointed at by address, neither), in all and for each pool of 4 MiB and more, with:
Diagnostics builds add a line for the title memory behind the textures the host itself writes: how much of it is on the card, under no title buffer, with nothing known to read it.
To tell these apart a page keeps one more byte of note as it moves. Nothing that moves pages reads it.
The second commit only adds parentheses where clippy's precedence lint asked for them in the new line's megabytes; the values are the same.
Measured
On one machine (
x86_64-pc-windows-msvc, tests under Wine on Linux, RADV):umtests: 4 passed, 1 ignored (2 new: a page on the card falls in one bucket; a page going up is told by its pool and its watch);--lib --bins --tests): 51 warning lines, as on main (59 before the second commit).Not measured
🤖 Generated with Claude Code
@Kal0s-design on GitHub · 2026-12-04 17:09 UTC · original
Checked
345f3aeon top of main and ran the tests natively on Windows (MSVC build, not Wine) on an NVIDIA card.umfilter: 16 passed, 1 ignored, both new residency tests among themum::with--features diagnostics, sobehind_lineandhost_written_memoryget built: 4 passed, 1 ignoredLooks fine to me. Nothing that moves pages reads
note. The tick only gets cheap additions: a load plus a one-timefetch_orper heated page (um/residency.rs:642-643), a store and a counter bump per page that goes up (870-872), and one counter per touched page that comes back down (928). These all run on the tick's own thread, next to a driver move, so the cost doesn't matter. The origin is read beforeRETIREDis cleared at line 882, so WATCHED can actually show up, andstore(origin)clears HEATED_UP on every promotion, which gives "since it came to the card".On locks,
reads_line(1129) holdsPOOLS.read()while it walks every page, the same way the existingline()does at 1052, so it takes no new lock.host_written_memory(resource.rs:2795) keeps the texture table guard for the whole walk, so the rawResourcederefs are covered, and the guard drops beforebehind_linetakes the pool copy and the shadow lookups. The two new tests cover the bucket precedence and keeping the origin bits apart from HEATED_UP. A swapped check would fail them, but they don't exercise the wiring intick.One nit. Clippy with
--features diagnosticsstill reportsprecedenceon the newbehind_line(um/residency.rs:1249, 1257-1259, 1267 and on), which the second commit didn't reach because it only builds without diagnostics. The values are right,*binds before>>.AI-assisted: yes
@Luxuride on GitHub · 2026-12-04 17:15 UTC · original · edited 2026-12-04 17:21 UTC
Fair — the body says it is taken out of the reuse change of #374, so the overlap is intentional; that is my miss, I compared diffs before reading the body.
The one thing worth a line somewhere is that both copies stay live until one of them moves: 230 of the 238 substantive lines here are the code #374 still carries, so if #374 lands first this becomes a conflict rather than a review, and if this lands first #374 needs those lines taken out. Naming that in either body is enough — no change needed here.
github-bot referenced this pull request2026-12-04 20:54:49 +00:00