The fresh test called IOMemoryDescriptor::getPageCounts(resident, dirty,
swapped) through a weak import, and on 11.7.11 every boot panicked at the
first fresh-surface test. OpenCore binds the absent symbol's word to 0, then
the kernel rebases it by the collection's slide, so the kext read
0xffffff8040000000 plus the slide as a definition and called it (WindowServer,
page fault in rgfxSurfaceLocksFresh, caught on serial).
The kext now maps the surface's memory read-only into the kernel's map for the
count and walks the mapping's regions with mach_vm_region's
VM_REGION_EXTENDED_INFO. That walk counts each page resident or compressed or
paged out (pages_swapped_out), measured on 11.7.11 against each page's
disposition with the pages in the compressor and on swap. mach_vm_region and
kernel_map are strong imports from com.apple.kpi.unsupported, which every
release kernel checked exports (x86-64 11.7.10 to 26.7.2, arm64 13 to 26),
so one route serves every kernel and both architectures.
The counts count only where the regions are the mapping exactly
(rgfxRegionPageCounts, tested). A region past it, a gap, a pager's memory or a
region with nothing to count refuses the count, so the rule can only refuse a
deferral. For the guest, macOS 11 to 15 defer fresh surfaces again, as 26
does, and no kernel calls an unbound word. A count's time is logged when it
is the longest yet, and for the first large surfaces.