diff options
| author | DadaCap <167002618+DadaCap@users.noreply.github.com> | 2026-11-27 16:35:37 +0100 |
|---|---|---|
| committer | DadaCap <167002618+DadaCap@users.noreply.github.com> | 2026-11-27 16:38:40 +0100 |
| commit | 7afb87266f6a5f692f9b68aaf49da2cf17eacfb7 (patch) | |
| tree | 022859a0607c7baca120f6581a53a788fc15489e /docs/d3d12_vulkan.md | |
| parent | e1f82510a07d963c6f4f0489c3d1396c00d8633d (diff) | |
d3d12: a retired window's copy goes back byte by byte (RT-TITLE-WINDOW-RETIRE)
ShadowPages::write_back compared the copies in 256-byte pieces and kept
one flag per piece: once a live copy had changed any byte of it, a
retired window's copy was left out of the whole piece. A retired window
and the slot-133 buffer that replaced it can have written disjoint
bytes of one piece (the window [384, 512), the buffer [256, 384)), so
the window's bytes were dropped. The batch path (`only` null) had the
same flag (`live = live || pass == 0`).
The piece now keeps a fixed 256-entry mask on the stack (no heap under
lock_) of the bytes a live copy changed, set in the first pass; a
retired copy goes back on every byte it changed that no live copy did,
in runs. Copies are still compared against the title's bytes as they
were before any copy went back, and a live copy now writes only the
bytes it changed, so one live copy no longer writes the title's older
bytes over another's result in the same piece.
d3d12_title_va_test --window-orphans: the held submission writes through
the window from ring + 384, a later one through the buffer placed over
the ring from ring + 128, and all the held words must reach the title's
pages (32 of 64 did before). The ring is write-combined so the buffer is
a copy on every driver. New ctest entry d3d12_title_window_orphans_free
runs it with LEONIDA_TITLE_WRITEBACK=0, where the window's free is the
only way back.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gt9hwNPurxyJ9LAfUbNiYr
Diffstat (limited to 'docs/d3d12_vulkan.md')
| -rw-r--r-- | docs/d3d12_vulkan.md | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/d3d12_vulkan.md b/docs/d3d12_vulkan.md index 20a7a0c75..92b603054 100644 --- a/docs/d3d12_vulkan.md +++ b/docs/d3d12_vulkan.md | |||
| @@ -1722,7 +1722,8 @@ The copies: | |||
| 1722 | (`src/command_list_epochs.h`). Until then its copy stays a target of its pages' tracker, refreshed like the others, | 1722 | (`src/command_list_epochs.h`). Until then its copy stays a target of its pages' tracker, refreshed like the others, |
| 1723 | and what the GPU wrote in it goes back to the title's pages: with its submissions' write-back, and once more when it | 1723 | and what the GPU wrote in it goes back to the title's pages: with its submissions' write-back, and once more when it |
| 1724 | is freed (a range noted when a list was recorded can be copied back before a held batch has run). A retired copy goes | 1724 | is freed (a range noted when a list was recorded can be copied back before a held batch has run). A retired copy goes |
| 1725 | back only where no live copy over the same bytes changed them, and every copy is compared with the title's bytes as | 1725 | back only on the bytes no live copy over them changed, byte by byte (the window and the buffer that replaced it can |
| 1726 | each have written their own bytes of one 256-byte piece), and every copy is compared with the title's bytes as | ||
| 1726 | they were before any copy went back. `d3d12_title_window_orphans` covers it, with a writing batch held on a fence | 1727 | they were before any copy went back. `d3d12_title_window_orphans` covers it, with a writing batch held on a fence |
| 1727 | while the next submission's refresh retires its window. A window is | 1728 | while the next submission's refresh retires its window. A window is |
| 1728 | not retired when its pages are released or remapped: a retail run measured no release at all of the pages windows | 1729 | not retired when its pages are released or remapped: a retail run measured no release at all of the pages windows |
| @@ -1740,7 +1741,7 @@ The copies: | |||
| 1740 | title itself wrote in between keeps the title's newer bytes and its GPU result is dropped. The copy back asks the | 1741 | title itself wrote in between keeps the title's newer bytes and its GPU result is dropped. The copy back asks the |
| 1741 | write watch first (the refresh's own asking comes after it, so a hot page's last answer is a submission old), passes | 1742 | write watch first (the refresh's own asking comes after it, so a hot page's last answer is a submission old), passes |
| 1742 | over pages whose mapping changed, that a kernel write may be filling or that xmem maps at another address too, and | 1743 | over pages whose mapping changed, that a kernel write may be filling or that xmem maps at another address too, and |
| 1743 | writes only the 256-byte pieces where the copy differs from the title's bytes: a read-only view writes nothing and | 1744 | writes only the bytes where the copy differs from the title's (compared in 256-byte pieces): a read-only view writes nothing and |
| 1744 | its pages stay guarded. The copy runs under the tracker's lock and can still fault on a page another guard keeps | 1745 | its pages stay guarded. The copy runs under the tracker's lock and can still fault on a page another guard keeps |
| 1745 | read-only (the geometry watch, another view's shadow): the fault handler asks every tracker over the address, this | 1746 | read-only (the geometry watch, another view's shadow): the fault handler asks every tracker over the address, this |
| 1746 | one included, and on the thread whose copy faulted it does not take that lock again (an SRW lock is not | 1747 | one included, and on the thread whose copy faulted it does not take that lock again (an SRW lock is not |