Repository navigation
dstorage: reads into physical pages wait for the title's Submit (DSTORAGE-HOLD-PAGE-READS) - #2124
Conversation
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
|
Review at One question before it is on by default: the hold changes behaviour for any title path that enqueues a read into physical pages, then a status/fence/event entry, and waits on that entry without calling Submit, counting on the self-submit at half capacity. Today that path runs; with the hold it waits Native Windows 10 run (the description has Windows 11): GTX 1050 Ti host, Windows 10 Pro 19045, MSVC RelWithDebInfo, this head merged onto main AI-assisted (Claude Code). |
|
Thanks for the review and the Windows 10 / GTX 1050 Ti run. On the question: I have data from real boots. Our test build has carried this same hold (same code, Your point stands for other titles, though. If you or the maintainers prefer, I can make the timed release default to 0 ms (no hold time, only the full-queue release), or ship the hold off by default behind On 16 vs 15 failures with the hold off: that mode is only there to show the test tells the two modes apart; the count isn't asserted. Which reads the worker reaches before the test rewrites the page list depends on thread timing, so a one-check difference between machines is expected. AI-assisted (Claude Code, Claude Opus 5.5). |
A queue with auto-submit on submits itself once the entries enqueued since the last submit reach half its capacity (
enqueue()→submit_locked()). A request into physical pages names its pages throughDestinationPageArray, which the worker reads only when the request runs (publish()→page_transfer()). The title fills that page table just before it calls Submit. So a read started by the self-submit finds page 0 (the entry fails with E_INVALIDARG) or the page number the slot held before (the data lands in a page that now belongs to something else, with no error).LEONIDA_DSTORAGE_HOLD_MSbounds a hold (2000 ms by default, 0 for no limit), so a path that never calls Submit cannot stall for good.LEONIDA_DSTORAGE_HOLD_PAGES=0restores the old behaviour.[rt] ds-holdcounts self-submits, held reads, full-queue and timed releases, and page lists that were still empty when read.Tests (Windows 11, RTX 4070 SUPER, VS 2022, Ninja)
dstorage_testwith the newtest_page_reads_wait_for_submit: 551 checks pass. WithLEONIDA_DSTORAGE_HOLD_PAGES=0, 15 of them fail: the read lands in the page the list named before, and an empty list fails.test_runtime_pathsworkflow check fails, as on main.Idea from fxceless/victory-fork 79cfdd9 (after Marvisak/VIctory eddde73), written anew for this queue.
AI-assisted (Claude Code, Claude Opus 5.5).
🤖 Generated with Claude Code
https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf