<feed xmlns='http://www.w3.org/2005/Atom'>
<title>npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/runtime/src/dstorage_hold.h, branch docs/pso-cache-scope-note</title>
<subtitle>[no description]</subtitle>
<id>https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/atom?h=docs%2Fpso-cache-scope-note</id>
<link rel='self' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/atom?h=docs%2Fpso-cache-scope-note'/>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/'/>
<updated>2026-11-25T21:35:47+00:00</updated>
<entry>
<title>dstorage: reads into physical pages wait for the title's Submit</title>
<updated>2026-11-25T21:35:47+00:00</updated>
<author>
<name>QemmHD</name>
<email>290605352+QemmHD@users.noreply.github.com</email>
</author>
<published>2026-11-25T21:05:35+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=6b09de493cef367f2fd48c1e73583a277732c9ff'/>
<id>urn:sha1:6b09de493cef367f2fd48c1e73583a277732c9ff</id>
<content type='text'>
A queue with auto-submit on submits itself once the entries enqueued
since the last submit reach half its capacity. A request whose
destination is a physical page list names its pages through
DestinationPageArray, a pointer into the title's own page-number table,
and the worker reads that table only when the request runs
(page_transfer). The title fills the page table just before Submit. So a
read started by the self-submit found page 0 (the entry failed) or the
number the slot held before (the data landed in a page that now belongs
to something else, with no error).

A self-submit now stops at the first read into physical pages. That read
and every entry behind it wait for the title's Submit, in order, so a
status entry, fence or event behind a held read still comes after it. A
full queue submits the held entries too, since the title cannot call
Submit while it waits in an enqueue. Close submits everything, as
before. A hold also ends after LEONIDA_DSTORAGE_HOLD_MS (2000 ms unless
set; 0 means no limit), so a path that never calls Submit cannot stall
for good. LEONIDA_DSTORAGE_HOLD_PAGES=0 restores the old self-submit of
everything.

"[rt] ds-hold" counts self-submits, held reads, full-queue and timed
releases, and destination lists that named page 0 when written. It is
printed at each power of two of the counter that moved
(runtime/src/dstorage_hold.h).

The idea is from Marvisak/VIctory eddde73; it also appears in
fxceless/victory-fork 79cfdd9. Written anew for this queue.

Test: dstorage_test, test_page_reads_wait_for_submit: a list changed
between the self-submit and Submit, a list still empty at the
self-submit, a full queue, the default and an explicit time limit, no
limit, the switch, and the page-0 counter.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
</content>
</entry>
</feed>
