Repository navigation
Description
Summary
In 007 First Light (PPSA11386), the first in-game cutscene runs at 1 to 3 FPS on the Kyty backend; the menus run at 35 to 45. The scene is GPU-bound on texture uploads: about 330 to 360 MB per frame.
The texture cache keeps deleting and recreating the scene's full-screen images. The game places these images of different formats at overlapping offsets in one memory area. Each recreated image is uploaded in full (32 to 63 MB) from guest memory.
Found while testing past #31: the cutscene's first draw stops on a merged hull shader, and these numbers come from a local build that drops those draws.
Measurements
Three runs in the scene, 15 s each. Counters from Common::DebugCounters, per frame:
| per frame | |
|---|---|
| Frames per second | 1.6 to 3 |
TextureUploadBytes |
330 to 360 MB |
BufferUploadBytes |
5 to 14 MB |
GpuWaitNs |
200 to 600 ms |
Draws / Dispatches |
260 to 2400 / 310 to 420 |
GpuFaults |
160 to 270 |
kytyGpuExecutespends about half its samples inwin32u.dll(the GPU fence wait).- No CPU thread is close to full.
nvidia-smishows the GPU 70 to 80 % busy.
What the texture cache does
I logged every InsertImage of 3840x2160 or larger during one run in the scene (temporary print, not in any branch).
- 4733 images inserted, at only 868 distinct addresses.
- The same address, size and format was created again many times:
k16_16_16_16Float, 63 MB: 1636 timesk8_8_8_8UNorm, 32 MB: 1670 timesk11_11_10Float, 32 MB: 450 times
- Almost every insert overlaps an image inserted before it, usually at a different offset rather than the same start (old format -> new format, count):
71 -> 56 offset 1471
56 -> 71 offset 1418
71 -> 71 offset 486
36 -> 71 offset 306
56 -> 36 offset 306
36 -> 56 offset 202
56 -> 56 offset 164
56 -> 71 same start 120
So the game reuses one area (around 0x4267000000 to 0x4277000000) for several render targets and compute outputs at overlapping offsets, and changes which one occupies a range within a frame. That is the usual console pattern for transient resources.
Kyty replaces the overlapping image. The next draw or dispatch that uses the replaced one creates it again. InitializeImage (textureCache.cpp:1633) then uploads it from guest memory, because a new image is buffer-modified and CPU-dirty (textureCache.cpp:1643).
A summary of the uploads per 5 s window showed 1000 to 2000 images, almost all of these 32 and 63 MB images with write_count == 0.
Likely side effect
The picture in the scene is nearly black. Guest memory doesn't contain what the GPU last rendered into that range (that is only in the replaced host image), so a recreated image starts from stale guest data. This is an inference; I have not verified it.
Possible directions
Not tried:
- No upload when the GPU wrote last: when a new image's range was last written by the GPU into an image that is being replaced, don't upload from guest memory. Either treat the contents as undefined, as a transient alias would be on hardware, or copy or reinterpret from the replaced host image when the layouts are compatible.
- Extend the discarded-target skip:
WasDiscardedTargetalready skips the upload for render targets whose contents were discarded. The images thrashing here were, in a partial log, mostly requested as storage images (BindingType::Storage), which that skip doesn't cover. That needs confirming. - Keep host images per format for an aliased range: rather than deleting them on every overlap, keep them and track which one is current, to avoid the reallocation as well as the upload.
Happy to prototype one of these and measure it on this scene if you have a preference.
Environment
Windows 11, NVIDIA GeForce RTX 5080 (driver 617.42), WinLibs GCC 15.2.0, LLVM 21.1.8, AnyKyty at fe0d5b42b4 plus the guard page commit from #22 and a local drop of merged-hull tessellation draws (#31). Not checked on Linux; nothing here is Windows-specific.
AI-assisted: yes.
🤖 Generated with Claude Code
Activity
simnJS commentedon Nov 18, 2026
Great find, and the black picture fits: the replaced host image held the only up-to-date contents. Please go ahead. My preference, in order:
WasDiscardedTargetextension to storage images is fine as a cheap extra, but it won't cover the aliased compute outputs.Behind a switch (on by default,
0restores today's path), withTextureUploadBytes, fps and a screenshot of the 007 cutscene before and after, plus a check that title A and Subnautica are unchanged. Since 007's cutscene needs #31 first, a local drop of those draws is fine for measuring, just keep it out of the PR.Scramblrrrr commentedon Nov 19, 2026
Our Windows/NVIDIA test setup is now ready on bf195d2. #77 adds Windows coverage for the merged-hull fixture: all 15 Kyty shim tests pass, with merged and split each covering 1082/4096 pixels on RTX 5070 Ti / 617.42 and zero Vulkan validation errors against the baseline.
I am keeping the alias implementation separate from that test-port work. If there is a public WIP branch for the GPU overlap/content-transfer fix, I can cross-test its build and native fixtures on Windows. Actual 007 cutscene/image checks on this setup remain pending visual access; I will not call idle presentation counts gameplay FPS or use skipped tessellation draws as a rendering fix.
AI-assisted: yes.
simnJS commentedon Nov 19, 2026
Thanks @Scramblrrrr, and nice work on the Windows coverage in #77. There's no WIP branch for the alias fix on our side: nobody here is working on it right now. If you or anyone wants to take it, it's open, and we'll review it. The issue text has the root cause and the numbers to check against: per-frame uploads of 330-360 MB going down, and the cutscene FPS.
SleglJan commentedon Nov 19, 2026
I'm working on this one; XatiX handed it over to me. The change carries the contents across on the GPU, as you suggested. The GPU-written images under the new one are written back into a device-local buffer, and the new image is uploaded from it, or copied directly when the layouts match. Anything it can't order safely falls back to today's upload, and
KYTY_ALIAS_CARRY=0turns it off. It covers DCC/CMASK colour images and depth sources and passes its own tests on lavapipe. It hasn't run in the cutscene yet: the title hangs the GPU here soon after (#98), and each hang has taken the desktop down, so the in-scene numbers are pending. I'll open the PR once I have them; a Windows cross-test then would be welcome.AI-assisted: yes (Claude Code)
SleglJan commentedon Nov 19, 2026
First in-scene numbers for the GPU carry (local branch on f394e91, one binary,
KYTY_ALIAS_CARRY=0vs1, warm caches, one run each, 007 First Light cutscene 1 over flips 5000–5599, RX 9070 XT / RADV, Mesa 26.2.6): it barely fires in the scene, so no PR yet. What stops it, in case it helps the write-back work on #30:buffer_newer: a logged buffer write over the source is newer than the source's last write.ObtainBuffermark the whole binding GPU-dirty (descriptors.cpp:162-164passes the full range and the shader-level write flag), whether or not the shader writes those bytes. The carry's own log, which only takes writes over pages that hold images, recorded about 480k such binds in that cutscene part.ObtainBufferForImage. Finer tracking of what a storage binding really writes is what would let the carry through.The carry passes its own tests (30 on lavapipe, each of 31 deliberate breakages caught, validation layer clean). I'll keep it local unless you see a use for it as is.
AI-assisted: yes (Claude Code)
simnJS commentedon Nov 20, 2026
Status at
AnyKytyde0fa04: there is no fix on the head yet, and no branch that moves the numbers.The root cause above stands. @SleglJan's GPU carry (local,
KYTY_ALIAS_CARRY) passes its tests but carried 69 images (25 MB) over 600 flips of the cutscene, and 89 % of its refusals arebuffer_newer: a logged buffer write over the source image is newer than the source's last write. Almost all of them (52,189 of 56,632 in the longer run) come from writable storage-buffer bindings that overlap the image. On the head, a binding with the write flag marks its whole range GPU-dirty in the buffer cache (ObtainBufferwithresource.written, indescriptors.cpp), whether or not the shader writes those bytes, andInvalidateMemoryFromGPUonly retires images that start at the written address.So the next step is not more carry code: it is tracking what a writable storage binding really writes. It is the same defect as R3 in #108, and until it is fixed the cutscene stays at 1-3 FPS.
65a1b01db4(compare-and-write) covers readbacks into guest memory and does not change this.Open to anyone; comment here first so two people do not do the same work.
SleglJan commentedon Nov 20, 2026
On the 1-3 FPS in the status: on RADV, cutscene 1 ran at 28.7 to 29.7 FPS on
82039de925, two commits beforede0fa047bb. I haven't runde0fa047bbor later.82039de925, one run: 106 s, 3,142 frames, 29.6 FPS. Three runs on local builds of the same commit (MaxTables = 64, and a counter build run with 8 and with 64) gave 28.7 to 29.7 FPS. All four are on perf(kyty): write reused image tables instead of copying their descriptors #99.ede8f30095plus perf(kyty): write reused image tables instead of copying their descriptors #99's first three commits, one run on 2026-11-19: 250 s, 997 frames, 4.0 FPS. That run had perf sampling windows in it; outside them it also ran at about 4 FPS.On
82039de925the title's draws no longer reach the table-resolution path (counters on #99). #109 (5b1fe32f94: sampled-float bindless texture tables through the image heap, on by default) landed between the two builds and would fit. I haven't bisected it or run cutscene 1 with it off. In gameplay from our save on82039de925,KYTY_IMAGE_TABLE_HEAP=0ran at about 4 FPS instead of about 28 (one run each, on #98).I haven't measured the texture-upload volume on
82039de925, and the carry isn't rebased onto it. So I can't say whether the per-frame re-uploads from this issue are gone, or still there and no longer the limit. The flip window 5000-5599 from my earlier comment doesn't compare on this build either: flip 5000 now comes on the licence screen of the first launch, and cutscene 1 starts near flip 11,600.Setup: Linux, RX 9070 XT, RADV (Mesa 26.2.6), kernel 7.3.4, the local title patch from #98.
AI-assisted: yes (Claude Code)
simnJS commentedon Nov 20, 2026
Thanks @SleglJan, 4.0 → 29.6 fps on cutscene 1 is a big jump (×7), and #109 (texture tables through the image heap,
5b1fe32f94) landing in between fits. That's also why your counters on #99 show no table resolutions any more. When you next run that cutscene on the current head, one look at the texture upload volume would tell us whether this issue's per-frame re-uploads are gone (then we close it) or just no longer the limit (then it stays open, lower priority).docs(kyty): bring the AnyKyty issue list and the 007 and Planet Zoo r…
[-]kyty: texture cache recreates and re-uploads aliased full-screen images every frame (007 cutscene at 1-3 FPS)[/-][+]kyty: texture cache recreates and re-uploads aliased full-screen images (007 First Light, cutscene 1)[/+]simnJS commentedon Nov 22, 2026
Status at
AnyKytya4b4360d66: no change aimed at this issue has landed. Since the image heap serves bindless texture tables (5b1fe32f94), cutscene 1 runs at about 29 FPS on RADV instead of 1 to 3, so the title now says what is measured rather than the old frame rate.What decides this issue is one number on the current head: the texture upload volume per frame in cutscene 1 (the
TextureUploadBytescounter of the first report). If the per-frame re-uploads are gone, we close it; if they are still there but no longer the limit, it stays open at a lower priority.simnJS commentedon Nov 26, 2026
@SleglJan, when you next run cutscene 1 on the current
AnyKyty, one number decides this issue:TextureUploadBytesper frame in the cutscene. Your #290 (64 MiB VMA blocks) landed since, so it is also the first check of memory use on RADV with it. If the per-frame re-uploads are gone, we close this; if they are still there but no longer the limit, it stays open at a lower priority.SleglJan commentedon Nov 26, 2026
Measured on
e68fe52755, which includes #290, plus a test-only line that prints theCommon::DebugCounterstotals at every 30th call ofAgcDriverPresentBuffer_nid_postfix, one call per flip of a guest display buffer. The current tip9ceedb5409adds one commit on top, which rejects invalid image LOD and compute exports in the shader translator.KYTY_PERF_OVERLAY=1switches the counters on; the overlay itself is not built.Setup: Linux 7.3.4, RX 9070 XT, RADV GFX1201 (Mesa 26.2.6), the local title patch from #98. Two runs by the new-game route, the first with empty caches and the second with the first run's caches. Both stopped at their 660 s cap at cutscene 2's L prompt, without an error exit and without an amdgpu fault, timeout or reset in the kernel log.
The cutscene-1 window lies between the first and last letterboxed screenshots the screen log kept: one row every 5 to 6 s, and a shot is kept when its OCR text changes. That gives 79 s and 73 s; the counted intervals cover 76 s and 73 s. The window can miss the cutscene's first and last seconds, so its frame rate does not compare directly with the 29.6 FPS I gave on
82039de925(106 s, from the cutscene's first row to the frame-rate spike at its end).Cutscene-1 window, per frame, from 30-frame intervals:
TextureUploadBytes, meanTextureUploadBytes, median (min to max)BufferUploadBytes, meanTextureEvictionsGpuWaitNsGpuFaultsDraws/DispatchesThe texture upload means are 335 and 339 MB per frame. The first report gave 330 to 360 MB at 1.6 to 3 FPS, on Windows with an RTX 5080, on
fe0d5b42b4plus #22 and a local drop of the merged-hull draws. In the menus before the campaign (offline dialog, main menu and difficulty selection; 60 s ending at about the start press), the same counter reads 390 and 245 MiB per frame at 59.94 FPS.What the counter covers:
TextureUploadBytesaddslinear.sizeinTextureCache::UploadImageand the partial layer upload (UploadImageLayers). Some other buffer-to-image copies, such asCopyToImageand the stencil copies, are not counted.InitializeImageand the partial layer upload), the source is whatBufferCache::ObtainBufferForImagereturns: a buffer-cache buffer, or a staging copy of guest memory when no cached buffer covers the range and the range is not GPU-modified.ApplyPartialBufferCopyalso counts a re-upload of an image from a device-local scratch copy.So the counter does not say how much of it crosses PCIe. It also does not separate uploads into recreated images from other uploads; I did not log
InsertImageas the first report did.Memory, same runs (VRAM and GTT from amdgpu
mem_info_vram_usedandmem_info_gtt_used, 1 Hz, device-wide; 0.6 to 1.0 GiB VRAM before the launch). The harness launches the title twice; the second launch is the measured one.memory.peak, page cache included), reached after the cutscene-1 window. In the windowmemory.currentis at most 13.4 and 13.9 GiB. Swap is off for that cgroup.AI-assisted: yes (Claude Code)
simnJS commentedon Nov 26, 2026
Thanks @SleglJan, that answers it. The per-frame re-uploads are still there (about 330 MiB per frame through the cutscene), but they are no longer the limit: 38 to 42 FPS on RADV now, against 29.6 before. As agreed, this stays open at a lower priority.
Two things from your numbers that we will follow:
InsertImagecount per frame in the same window, as in the first report. Only if you have time.SleglJan commentedon Nov 26, 2026
InsertImagecounts in cutscene 1, by the same window rule, from one more run set up like run 2 (warm caches, same commite68fe52755). The test-only line now also counts calls ofTextureCache::InsertImage. A re-insert is an insert whose (data.address,data.size,guest_format) was already inserted earlier in the same process; in the 1280x720 row, already inserted at 1280x720 or larger. The counter does not tell whether the earlier image was freed in between.extent1280x720 or largerextent3840x2160 or largerTextureUploadBytesin the window is 325 MiB per frame (mean; median 328 MiB). Runs 1 and 2 gave 320 and 323 MiB.TextureUploadBytesthere reads 126 MiB per frame (runs 1 and 2: 390 and 245).For comparison, the first report logged 4,733 inserts of 3840x2160 or larger during one run in the scene, at 868 distinct addresses. Its counter runs were 15 s each, at 1.6 to 3 FPS. The same filter here gives 8,496 inserts in the window. These counts key on address, size and format together, not on the address alone; I have no distinct count for that row.
AI-assisted: yes (Claude Code)
simnJS commentedon Nov 26, 2026
Thanks, this is very useful. Two thirds of the inserts in the window (49.0 of 73.9 per frame) are re-inserts of a key that already existed earlier in the process, so most of the ~325 MiB per frame is the same images being dropped and created again, not new data.
One thing would tell us where to look: what dropped those images before they were re-inserted. If the same counter line can also count, per frame, the images removed by the GC (eviction under memory pressure) and the images invalidated because guest memory under them was written, the split will show whether this is a cache-size and eviction problem (#306) or a write-tracking problem (an overlapping write invalidating images that did not actually change).
SleglJan commentedon Nov 26, 2026
From one more run set up like runs 2 and 3 (warm caches,
e68fe52755). In the cutscene-1 window, 62.7 of the 64.4FreeImagecalls per frame come from overlap resolution and 1.08 from the GC. NeitherInvalidateLockednorInvalidateMemoryFromGPUfrees an image in this tree. The counters still do not pair a re-insert with the removal of its key's earlier image. The test-only line now also counts:FreeImageandParkImagecall site inTextureCache;InvalidateLocked: whole-image CPU-dirty, partially dirty and maybe-dirty (not its first- and last-page untracks);InitializeImageuploads, split by the image's state.The window, by the same rule: 63 s between the shots; the counted intervals cover 62.6 s, 2,730 frames, 43.6 FPS. Going by the subtitles in its first and last shots, it starts and ends within a shot of run 3's window.
Removals in the window:
FreeImage, all callsResolveOverlap, its last case (see below)RunGarbageCollector(eviction)FindImageImpl, cached image has fewer resources than requestedExpandImage0.11, stencil associations 0.07, the other twoResolveOverlapcases 0.05,ResolveDepthOverlap0.01;BcAliasandUnmapMemorynoneResolveDepthOverlap, parked instead of freed (not aFreeImagecall)DiscardParkedImage(not aFreeImagecall)ResolveOverlap: a requested image overlaps a cached one. They are not at the same address with the same block extent and block size, and neither is a mip of the other. The requested image starts at or after the cached one, and the cached image issafe_to_delete: not a bound depth target, no table pins or heap references, and not accessed for more thanNumFramesBeforeRemoval(16) GC ticks.FreeImagecalls. GC evictions equalTextureEvictions(1.08 per frame).InvalidateLockednever frees an image. It marks it CPU-dirty, partially dirty or maybe-dirty, or stops tracking its first or last page (not counted). In the whole window there were 5 whole-image CPU-dirty marks, no partial ones, and 5.4 maybe-dirty marks per frame.Uploads:
TextureUploadBytesis 310 MiB per frame in this window (run 3: 325), all of it uploaded insideInitializeImage:Inserts in the window: 70.7 per frame, 46.9 of them re-inserts (run 3: 73.9 and 49.0).
AI-assisted: yes (Claude Code)
simnJS commentedon Nov 26, 2026
This settles where the churn comes from, thanks: 62.7 of 64.4 frees per frame are the last case of
ResolveOverlap, and guest writes free nothing. So the title reuses the same memory for images of different shapes every frame, and each switch frees the cached image and builds the requested one again from guest memory (159.5 MiB per frame of first fills of re-inserted keys).Two fixes are possible, and one more split decides between them. For the images created by that case, how many of the bytes uploaded in
InitializeImageare for an image whose first GPU use writes it (a render target, a depth target, a storage image or a clear) rather than reads it (sampled, or a copy source)?ResolveDepthOverlap, and brought back when its key is requested again, as long as nothing (CPU or GPU) wrote its range in between.Would you like to take it once the split is known? It fits your counters, and a PR that moves
TextureUploadBytesin this window would be easy to judge.SleglJan commentedon Nov 26, 2026
The split, from one more run set up like runs 2 to 4 (warm caches,
e68fe52755). The test-only line now records, for every upload inInitializeImage, the innermost tagged use on the call stack. Most first fills happen lazily, throughRefreshImage, at the first use that finds the image CPU-dirty, so that use is the image's first use. The exceptions:ClearImageandMaterializeColorClearcallInitializeImagedirectly (see Limit), andExpandImagefills its new image right after the insert (no use tag, so under Other). An image whose first use uploaded nothing (a full clear, or a target skipped byWasDiscardedTarget) has its first counted fill at a later use. Window by the same rule: 69 s between the shots; the counted intervals cover 68.6 s, 2,970 frames, 43.3 FPS.First fills per frame, by the use that triggered them:
FindTexture, storage binding)ClearImage,MaterializeColorClear,ClearImageFromBuffer)FindTexture, texture binding)ResolveOverlap's last case freed an image earlier in the sameFindImageImplcall. The flag only links an insert to a free in the same request, so it does not cover every image created by that case, and it does not prove that each flagged image replaced the freed one. A stencil plane inserted when a depth target is bound or cleared takes the flag of the thread's lastFindImageImplcall.TextureUploadBytes, 300.7 MiB per frame (run 4: 310), so no upload in the window came from outsideInitializeImage. The frees are 62.2 per frame, 60.2 of them fromResolveOverlap's last case (run 4: 64.4 and 62.7). Inserts are 68.7 per frame, 43.1 of them re-inserts (run 4: 70.7 and 46.9).ClearImagecallsInitializeImageonly when the clear does not cover every mip, layer and aspect; a full clear uploads nothing.MaterializeColorClearfills during the lookup, before per-slice clears that the GPU runs only if its metadata check passes.Yes, I'd like to take the fix. Because of that limit, I'll first check which of these first uses read the old contents before deciding between skipping the fill and parking.
AI-assisted: yes (Claude Code)
SleglJan commentedon Nov 27, 2026
Two more measurements on the storage first fills, which are 205 of the 281 MiB of first fills per frame in the cutscene-1 window. Both runs were made on
e68fe52755with test-only counters, set up like runs 2 to 5 (warm caches).1. What the shader does with the image, and what the upload brings (run 6, a window by the same rule; the counted intervals cover 71.1 s and 3,180 frames):
ImageResourcewrittenand notreadoratomic, set aroundFindTexturein the descriptor image loop). Thereadflag is an upper bound on real reads.IsBufferModified()whenInitializeImagestarts, meaning the buffer cache holds GPU-written bytes in its range.DeleteImageremovals withoutFreeImageare not seen.So skipping these fills is only safe if what they bring in is overwritten before anything reads it.
2. What the first dispatch changes (run 7, a second test-only build, the whole run rather than only the window):
Method: for 1 in 16 of these fills, the build downloads the image twice through Kyty's own
DownloadImage, each time into its own zeroed buffer:It then compares the two, element by element (
bytes_per_blockbytes each, all levels and layers).Control: for 1 in 32 samples, it took two downloads back to back. All 1,392 pairs matched exactly. This shows only that the downloads are stable; there is no positive control showing that a known full overwrite reads as fully changed.
Coverage of the sample:
Results:
Limits:
So this data doesn't support a plain skip for write-only storage first uses. Render-target, depth, clear, sampled and other first fills (76 MiB per frame) aren't covered here.
AI-assisted: yes (Claude Code)
github-actions commentedon Nov 27, 2026
Thanks, this rules out using a write-only storage binding as the sole condition for skipping the initial upload. The readbacks measure changed values, not write coverage, so they don’t establish whether the remaining contents are overwritten before a later read.
For a narrow first prototype, can you measure how many first-fill bytes are triggered by clears that provably overwrite every aspect, mip level, and layer the upload would initialize? That would give us a safe case to test without changing storage-image behavior.
SleglJan commentedon Nov 27, 2026
None, in this run. All clear-triggered first fills come from
MaterializeColorClear. Each slice's clear of one level runs only if a GPU check finds that slice uniformly fast-cleared, so it is never provably full when the upload is recorded.This is from run 8, one more run on
e68fe52755with a test-only counter, set up like runs 6 and 7 (whole run, 36,570 flips).ClearImage: it callsInitializeImageonly when the clear is notfull_image(all aspects, all levels, all layers), so a full clear already skips the upload. For a stencil clear that doesn't cover all subresources, it also refreshes the stencil plane. That site isn't classed here; it filled nothing in this run.ClearImageFromBuffer: it callsClearImagewith one aspect: all levels and layers for colour or depth, the stencil subresources for stencil.MaterializeColorClear: it callsInitializeImageand records a GPU check, per slice and clear key, of whether the slice's metadata is uniformly fast-cleared. It then clears that level's area of each slice under conditional rendering.InitializeImagethese paths call directly with its path and coverage and counts first-fill bytes, by the same rule as the earlier splits. The tagged bytes matched the counter's total for clear-use first fills exactly.MaterializeColorClear(4.79 fills per frame).ClearImage, called directly or fromClearImageFromBuffer, triggered no first fill.ClearImage. The clear-use first fills that remain areMaterializeColorClear's upload before its GPU-predicated clear.ClearImagecalls that found the image clean, or that skipped the upload, are not in it.AI-assisted: yes (Claude Code)
github-actions commentedon Nov 27, 2026
Thanks, that rules out the full-clear prototype:
ClearImagealready skips the upload for unconditional full clears, andMaterializeColorClearhas to preserve contents when its GPU predicate is false. There’s no need to rerun that split just for the cutscene window.If you want to keep investigating, the next useful number is how many first-fill bytes could be avoided by reusing a parked image with the same cache key and no intervening CPU or GPU write to its range. A counter-only estimate would tell us whether parking is worth prototyping without changing upload behavior.
SleglJan commentedon Nov 27, 2026
At most about zero. For 81 % of the first-fill bytes whose key had an earlier image in the counter's table, a GPU write to an overlapping range was committed after that image left. The other 19 % was already out of date when the image left (
IsCpuDirtyorIsBufferModified).These are from run 9, one more run on
e68fe52755with a test-only counter, set up like runs 6 to 8 (whole run, 35,550 flips).ParkImageorFreeImage, if they were registered and non-empty. Entries are updated on discard and unpark.SameParkedLayoutcompares.IsCpuDirtyorIsBufferModified);InvalidateMemory, map and unmap events);CommitGpuWrite, which runs at write binds, clears and copies), or came from the copy hand-overs orInvalidateMemoryFromGPU;ParkImageandUnparkImageare called only fromResolveDepthOverlap. The other removals, includingResolveOverlap's last case, go throughFreeImage. An unparked image is refilled byCopyImagewhen the sample counts match, so parking today saves creating the image, not the fill.AI-assisted: yes (Claude Code)
github-actions commentedon Nov 27, 2026
Thanks. For the 197 MiB/frame matched by the counter, at most 0.04 MiB/frame could reuse cached contents unchanged. The bounded history leaves the unmatched fills unresolved, but the measured savings don’t justify a parking prototype to reduce uploads. Reusing allocations would be a separate optimization; it wouldn’t eliminate the refill.