ScarletNX / ScarletNX documentation / Regression inventory for the buffer cache rewrite · ← previous · next →
Results that the GPU writes (3)
- Without the rule: its result is what differs from the input after the dispatch. A store of the same value over
zeroed bytes would differ from nothing and never land.
- Comment:
compute.c, vk_dispatch.
- Check: no test covers it.
R52. The outputs of a dispatch are made after every input is read, and the slots of one buffer view one copy.
- Without the rule: an input can alias the output of another storage buffer. Loads, atomics and stores of one buffer
must each see the writes of the others.
- Comment:
compute.c, vk_dispatch.
- Check: no test covers it.
R53. Only a program that logs every buffer that it writes takes the mirror, and a Switch program does not take
it.
- Without the rule: a buffer written with no log never lands from the mirror. With the mirror, the props of one
Switch game vanished for one frame in 3 to 9 of 250 shots in each of three runs. They vanished in none of 250
with no mirror, and in none on a host with no traps. The comment says that the cause is not found.
- Comment:
compute.c, above mirror_plan.
- Check: no test covers the Switch case. Repeat the 250 shots if the rewrite changes which programs take the
mirror.
R54. The mirror holds the storage buffers of the programs that log, in place, one dispatch after another.
- Without the rule: each buffer is all the memory mapped from its address, up to 16 MiB. Made new for each dispatch,
with a copy in and a copy back, it cost a game most of its CPU and GPU time and gigabytes of rings. Hundreds of
16 MiB bindings a frame came at addresses a few KiB apart.
- Comment:
mirror.c, the file header, and compute.c, above mirror_plan.
- Check:
check_mirror in tests/vulkan_mirror.inc.
R55. When the mirror's pages land or are published as its own, a byte that both the program and the CPU wrote keeps
the CPU's value, where the page's shadow holds every byte from before the submit.
- Without the rule: the shadow holds every CPU write from before the submit, so a byte that differs from it was
written by the CPU after the submit. Landed over it, the program's older byte replaced it in guest memory and in the
shadow, and no later check could find it. One game's characters showed squares of wrong lighting. The shadow lacks
bytes in three cases, and the program's byte lands there as before: the page landed since it was given its bytes, a
render target was written back over it just before, or it had other owners when it was given its bytes. Before the
mirror publishes pages, it also takes in the CPU changes the program did not log: the first CPU touch lands a page
whole, which is exact only when the page holds them.
- Comment:
mirror.c, above land_entry, above vk_mirror_publish and at owned_at_fill.
- Check:
check_mirror in tests/vulkan_mirror.inc, the cases of a byte that the CPU wrote beside the program's, of
a byte that both wrote (landed and published), and of a logged byte over another owner's bytes (the shadow's valid
bit read after the owner lands).
R56. The write log of a dispatch in the mirror is in GPU memory, and a host log is cleared only where it was
written.
- Without the rule: on a discrete GPU each store crossed the bus two times. One game's upscaler program took 47 ms
of an RTX 5080 for a dispatch, against 0.14 ms with the log in GPU memory. The folds took 14 ms each, against
0.3 ms. A host log that is cleared whole costs the 16 MiB of the binding, not what the stores wrote.
- Comment:
writelog.c, the file header.
- Check:
check_mirror_fold in tests/vulkan_mirror.inc runs with the log in GPU memory.
R57. A publish on a host with no traps lands the neighbors on the edge pages first.
- Without the rule: other owned bytes can still trap the edge pages after the range is dropped, and the fallback
writes through the guest pointer.
- Comment:
owned.c, own_publish.
- Check: the ctest
memory_own_no_traps. No renderer test names the edge pages.
R58. On unified memory, a publish over memory that an import holds is a GPU copy in place, with no owner and no
trap.
- Without the rule: each trap let go of the imports over its pages, and the next use made them again. A watch on
such pages would take them from the import.
- Comment:
owned.c, own_publish and vk_own_watch.
- Check:
check_uma_publish in tests/vulkan_uma_imports.inc.
R59. A run with pending in-place writes that no one import holds whole is read part by part.
- Without the rule: a logged result written back across the edge of an import left such runs. The wait for its
submit took all the work recorded before it.
- Comment:
owned.c, above inplace_part.
- Check:
check_uma_logged_back in tests/vulkan_uma_imports.inc writes across an import edge.
← previous · next →