Make the memory census walk once and fire on the process's own commit, not on its private bytes.

With mem_census = 1 the census trigger compared the private bytes with the last census, and Windows charges the video memory to them, so every gigabyte of textures started another 130-260 ms walk on the presenting thread: 22 of the 33 walks of the 2026-11-13 session came from that trigger, while the process's own commit grew 307 MiB in play. The trigger now reads the private bytes less the write-combined memory of the last walk (and what the driver's device-local figure grew since), compares them with the highest figure seen at a census, and waits 60 s after the last walk; the 3600-frame censuses stay.

On Windows one walk of the address space now gives both the commit census and the guest regions' committed bytes, which mem_guest_census walked a second time. The census counts the driver's write-combined views apart instead of as guest memory, counts as guest only the reserved guest regions and the loaded modules, and ranks the process's own allocations wherever they lie. The frame after a walk charges its time to a new "census" cause in the frame-time summary and the stutter map instead of "unattributed".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-13 12:25:33 -05:00
parent f1a2a64e83
commit f7487ceee5
9 changed files with 195 additions and 49 deletions

View File

@@ -17,16 +17,18 @@ void rt_log(const char *fmt, ...) {
logged++;
}
static const char *const names[7] = {"pipeline", "translation", "texture", "fence", "pacing", "replay", "unattributed"};
// perf.c's causes, in its order (FT_C_*)
static const char *const names[8] = {"pipeline", "translation", "texture", "fence", "pacing", "replay", "census",
"unattributed"};
static uint64_t frame_no;
static void frames(int n, double ms) {
uint64_t part[7] = {0};
uint64_t part[8] = {0};
for (int i = 0; i < n; i++) {
uint64_t d = (uint64_t)(ms * 1e6);
clock_ns += d;
part[6] = d;
stutter_frame(++frame_no, clock_ns, d, part, names, 7, 6);
part[7] = d;
stutter_frame(++frame_no, clock_ns, d, part, names, 8, 7);
}
}