ScarletNX / ScarletNX documentation / Regression inventory for the buffer cache rewrite · ← previous · next →
Change detection (2)
- Without the rule: such a page holds no guest bytes, and the landing writes nothing there. One game's storage
results end 336 bytes into an unmapped page. Answered "changed", each binding of them landed, 15 waits for the GPU
in a frame.
- Comment:
buffer.c, copyable_span.
- Check:
check_unmapped_tail in tests/vulkan_unmapped_tail.inc.
D28. All images take their write generations from one count.
- Without the rule: a surface that counted its own writes ran ahead of the count of the uploads. An upload then gave
it a generation that its image would reach again with guest memory still at it. The next write looked written back
already and never landed.
- Comment:
surface.c, above g_surf_gen.
- Check: no test covers it.
D29. A texture with nothing left to take from drawn targets is passed over until the take count moves.
- Without the rule: a texture searched the drawn targets each time it was bound and found the ones that it copied
already. That was most of its searches in one game.
- Comment:
surface.c, above g_take_gen.
- Check:
check_take_after_writes in tests/vulkan_headless.c.
D30. A render target keeps the baseline of its first draw until the next present.
- Without the rule: a memory write after the first draw can leave untouched pixels stale even when later draws touch
the target. A new baseline at each draw also scanned the whole target each time. With no write tracking the
fallback is a hash, only for a target that a texture takes pixels from. A hash of every target at its first draw
of each present took most of the GPU thread on FreeBSD and on Linux before 6.7.
- Comment:
surface.c, vk_rt_drawn.
- Check:
check_wt_hot_rt_fresh in tests/vulkan_write_tracking.inc.
D31. A baseline takes in the earlier writes first, and then protects the hot pages again.
- Without the rule: writes from before the baseline counted as later ones. A hot page that is cooled before the
take-in stays hot past the baseline, so the target is not fresh although nothing was written.
- Comment:
surface.c, mem_baseline, run_take and run_cool.
- Check:
check_wt_hot_rt_take_in and check_wt_hot_page in tests/vulkan_write_tracking.inc.
D32. A render target loads from memory the GPU-side writes that the draws of the 3D engine do not see.
- Without the rule: inline uploads, constant updates and compute results land in memory. DMA and 2D copies make the
target load them, but those writes did not.
- Comment:
surface.c, vk_rt_note_read.
- Check: no test names it.
D33. GPU-owned bytes read as the identity of their owner, in whole words.
- Without the rule: a texture hash over GPU-owned memory read the tag byte by byte, a third of the GPU thread. An
owner that is written again in place, or a new owner at a freed address, must give a different identity, or a
texture over it keeps its old texels.
- Comment:
owned.c, vk_guest_peek.
- Check:
check_owned_peek_identity and check_owned_whole_identity in tests/vulkan_owned_readback.inc.
D34. After a merge that the CPU won in part, the surface changes its hash so that the next bind uploads.
- Without the rule: the image still holds the shader result where the CPU won. The write-back hashed the merged
bytes, so the next bind found the hash equal and kept the image.
- Comment:
surface.c, flush_land.
- Check: no test covers it.
D35. The mirror copies in only the bytes that the CPU changed, by a compare with a shadow in host memory.
- Without the rule: a copy of whole pages replaces the bytes that a program wrote there and that did not land yet.
- Comment:
mirror.c, the file header.
- Check:
check_mirror in tests/vulkan_mirror.inc.
D36. A mirror page with no pending program write is copied whole when a byte changed.
- Without the rule: a page that the CPU wrote in scattered bytes made one copy region for each run. One copy had
194,545 regions.
- Comment:
mirror.c, diff_run.
- Check: no test holds the region count.
check_mirror covers the whole-page copy.
D37. The mirror looks at the pages of a binding 64 at a time, by mask word.
- Without the rule: a binding is up to 16 MiB for each storage buffer of each draw and dispatch. A loop over the bit
of each page was a fourteenth of one game's GPU thread.
- Comment:
mirror.c, above vk_mirror_slice.
- Check: no test covers the cost.
D38. A mirror range that was brought up to date in this epoch needs no second walk in the epoch.
- Without the rule: a draw binds the same 16 MiB ranges as the draws before it. Three walks over 4096 pages at each
binding were 8% of an Ounce game's GPU thread.
- Comment:
mirror.c, vk_mirror_slice, at ck_epoch.
- Check: no test covers the cost.
D39. A page that landed loses its shadow, and the next binding brings it up to date whole from guest memory.
- Without the rule: the shadow no longer holds what guest memory holds, and a compare with it copies the wrong bytes.
- Comment:
mirror.c, vk_mirror_landed.
- Check:
check_mirror in tests/vulkan_mirror.inc, the binding after the CPU touch.
D40. On Windows the scanner starts no scan while a check scans.
- Without the rule: the write watch calls of two threads slow each other down. In one game a check took about 47 us a
leaf against the scanner's 4, on the thread that records the draws, and 12 us with the scanner waiting.
- Comment:
buffer.c, above g_wcheck_scans.
- Check:
vk_write_scan (tests/vk_write_scan.c), on any host.
← previous · next →