upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/directstorage.md
diff options
context:
space:
mode:
authorJan Trencansky <jan.trencansky@protonmail.com>2026-11-26 16:55:04 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-26 16:55:04 -0500
commitdf92abca8ee2a8f9093efea7fcaa4dadc3ddaebc (patch)
tree97ef8f95544fe263049d3f7360823f16100de209 /docs/directstorage.md
parent49a0b69fcdb80db1f2a44ce7ca0ab8dfdec1e403 (diff)
parente5a7c8942678b323f655939c81f5d8855d20c248 (diff)
Merge main e5a7c8942 into shadow-aliased-guard (#1867)
One conflict, runtime/README.md: this branch rewrote the LEONIDA_SHADOW_ALIAS_MS row, main (#2163) added the LEONIDA_SHADOW_KEEP row after it. Both rows kept; the keep row's "aliased" now reads "aliased while they can't be guarded at every address", since aliased pages are no longer copied without a sign of a write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/directstorage.md')
-rw-r--r--docs/directstorage.md29
1 files changed, 26 insertions, 3 deletions
diff --git a/docs/directstorage.md b/docs/directstorage.md
index 919d52282..1618d221f 100644
--- a/docs/directstorage.md
+++ b/docs/directstorage.md
@@ -84,6 +84,19 @@ The first boot with the executable settles most of this: the dry-run report show
84 `DSTORAGE_QUEUE_OPTIONS::AutoSubmitDisabled`). An enqueue into a full queue waits for space, as the reference 84 `DSTORAGE_QUEUE_OPTIONS::AutoSubmitDisabled`). An enqueue into a full queue waits for space, as the reference
85 says; with auto-submit disabled only a `Submit` from another thread frees it. One worker thread per queue runs 85 says; with auto-submit disabled only a `Submit` from another thread frees it. One worker thread per queue runs
86 the submitted entries in order, so every notification follows all the entries before it. 86 the submitted entries in order, so every notification follows all the entries before it.
87- **Reads into physical pages wait for `Submit`**: an automatic submit stops at the first request whose
88 destination is a physical page list; that request and every entry behind it wait for the title's own `Submit`.
89 A title may fill the page-number table such a list points into only in its submit path, so an early read finds
90 page 0 (the entry fails) or the number the slot held before (the data lands in a page that now belongs to
91 something else, with no error). A full queue submits the held entries too, since the title cannot call `Submit`
92 while it waits in an enqueue, and so does `Close`. The idea is from VIctory (`Marvisak/VIctory` `eddde73`, also
93 in `fxceless/victory-fork` `79cfdd9`); the queue here keeps its order, so entries behind a held read wait with
94 it. `LEONIDA_DSTORAGE_HOLD_PAGES=0` restores the automatic submit of everything. A hold ends after
95 `LEONIDA_DSTORAGE_HOLD_MS` milliseconds without a `Submit` (2000 unless set): the held entries are submitted with
96 their page lists as they are, as a timed release, so a path that never calls `Submit` cannot stall for good. `0`
97 is no time limit (a hold of five seconds is then logged once). The `[rt] ds-hold` line counts automatic submits,
98 reads held, full-queue and timed releases, and destination lists that named page 0 when written (`event=`, at
99 each power of two of the counter that moved).
87- **Requests**: copied at enqueue. A file request reads `SourceSize` bytes at `FileOffset` into `Destination`; a 100- **Requests**: copied at enqueue. A file request reads `SourceSize` bytes at `FileOffset` into `Destination`; a
88 memory request copies `Source` to `Destination` (`memmove`, so an overlapping pair is safe); a zlib request 101 memory request copies `Source` to `Destination` (`memmove`, so an overlapping pair is safe); a zlib request
89 inflates those `SourceSize` bytes into `Destination` (below). Checked in this order when the worker reaches the 102 inflates those `SourceSize` bytes into `Destination` (below). Checked in this order when the worker reaches the
@@ -190,7 +203,16 @@ The first boot with the executable settles most of this: the dry-run report show
190 256 blocks of a stream. It combines adjacent mips from the same layer with full-stream index anchor 203 256 blocks of a stream. It combines adjacent mips from the same layer with full-stream index anchor
191 and shared-p-bit constraints. A shared p-bit can relate low red endpoint bits even when its sibling 204 and shared-p-bit constraints. A shared p-bit can relate low red endpoint bits even when its sibling
192 mip supplies only the leading bits. These local fits preserve the recorded precision and exact reference 205 mip supplies only the leading bits. These local fits preserve the recorded precision and exact reference
193 bits. A profile can still lack endpoint values or exceed the reference consistency tolerance. Such a request reports a decompression error before publication. 206 bits. A packed tail whose larger mips are BCPack-coded too has no raw or zlib sibling, so a history field that
207 only such tails use stayed unknown: in the game runs of 2026-11-25 two BC7 tail streams of one pool failed
208 with `missing-endpoint` (alpha fields of two history entries). For the streams that still start a chain at a
209 missing field, the fitter now decodes the nearest BCPack sibling with the profile so far and fits against it,
210 repeating while a round adds fields. The sibling may sit in the same refused BC7 stream: every block whose
211 chains start elsewhere is still determined, and the undetermined ones are left out of the reference. Those
212 fields are fitted, never confirmed, and fill only what the other fits left empty. On the 1.0.2.1 package this
213 raised the BC7 endpoint fields from 4,228 to 4,406 of 6,144; the runtime decoder then refuses 8 of 5,167 BC7
214 streams instead of 60 (both failing requests decode), and the 268 BC6H streams are unchanged (10 refused; a
215 refused BC6H sibling is not used as a reference yet). A profile can still lack endpoint values or exceed the reference consistency tolerance. Such a request reports a decompression error before publication.
194- The four swizzle modes interleave stripes from request-wide component planes into 16 KiB (mode 1) or 216- The four swizzle modes interleave stripes from request-wide component planes into 16 KiB (mode 1) or
195 32 KiB (modes 2–4) groups. The enum names give the successive stripe widths. The shipped BC4 sample 217 32 KiB (modes 2–4) groups. The enum names give the successive stripe widths. The shipped BC4 sample
196 separates its endpoint planes from indices across the inflated source. The title's compute shader does 218 separates its endpoint planes from indices across the inflated source. The title's compute shader does
@@ -213,8 +235,9 @@ The first boot with the executable settles most of this: the dry-run report show
213 235
214`runtime/test/dstorage_test.cpp` (ctest `dstorage`) runs on synthetic files in `%TEMP%` through the registry entries 236`runtime/test/dstorage_test.cpp` (ctest `dstorage`) runs on synthetic files in `%TEMP%` through the registry entries
215under all three module names: `GAME:` reads with an overlay copy winning, offsets, zero size, a range past the end, 237under all three module names: `GAME:` reads with an overlay copy winning, offsets, zero size, a range past the end,
216cancellation, auto-submit, a full queue, status arrays, fences (a CPU fence object that checks the data is in place 238cancellation, auto-submit, reads into physical pages held for `Submit` (a page list changed or filled before it,
217when it is signalled), events, error records, file and queue close with requests in flight, a destination the 239a full queue, the time limit, the switch), a full queue, status arrays, fences (a CPU fence object that checks the
240data is in place when it is signalled), events, error records, file and queue close with requests in flight, a destination the
218process cannot write, four threads enqueueing at once, the interface-id policy (unknown and system ids refused by 241process cannot write, four threads enqueueing at once, the interface-id policy (unknown and system ids refused by
219`QueryInterface`, learned by creating calls), a `GetHandle` handle with its own file position, an event closed (and 242`QueryInterface`, learned by creating calls), a `GetHandle` handle with its own file position, an event closed (and
220its handle value reused) before it is set, and cancelled requests that also had an enqueue error. zlib requests use 243its handle value reused) before it is set, and cancelled requests that also had an enqueue error. zlib requests use