-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathReadyOSREUPhase1Completed.html
More file actions
3765 lines (3749 loc) · 217 KB
/
Copy pathReadyOSREUPhase1Completed.html
File metadata and controls
3765 lines (3749 loc) · 217 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<h1 id="readyos-reu-enhancement-refactor---phase-1-completed">ReadyOS
REU Enhancement Refactor - Phase 1 Completed</h1>
<h2 id="phase-1-completion-note">Phase 1 Completion Note</h2>
<p>This document is the completed Phase 1 implementation record for the
REU control-bank and dynamic-resource refactor. Phase 1 is complete as
of the <code>codex/reu-control-bank-refactor</code> branch checkpoints
through 2026-06-07: logical REU bank <code>0</code> is active, app
snapshots are dynamically allocated, ReadyShell and ReadyBASIC
loader-owned resources are dynamically assigned, app-owned runtime REU
allocations can be owner-recorded without shim growth, REU Viewer
consumes bank <code>0</code> metadata, physical REU size is
launcher-owned, and both regular plus EasyFlash/cartridge VICE suites
passed.</p>
<p>The active future plan has moved to
<code>futureREUrefactor.md</code>. The historical future-design sections
below are preserved for context, but they are no longer the primary
source of truth for pending work. When this document conflicts with
<code>futureREUrefactor.md</code>, use <code>futureREUrefactor.md</code>
for future work.</p>
<h2 id="purpose">Purpose</h2>
<p>This plan describes a future refactor that turns logical REU bank
<code>0</code> into a ReadyOS control bank while preserving the current
ReadyOS memory contracts, especially the resident shim and shim-adjacent
metadata area.</p>
<p>The intended long-term end state is:</p>
<ul>
<li>logical REU bank <code>0</code> is the canonical ReadyOS REU control
bank;</li>
<li>the resident <code>$C600-$C9FF</code> area remains small, fixed, and
ABI-stable;</li>
<li>the shim itself does not grow;</li>
<li>app snapshots, overlays, modules, clipboard payloads, ReadyShell
resources, ReadyBASIC resources, and app-requested banks are tracked by
owner;</li>
<li>apps can be loaded/preloaded dynamically instead of being tied to
fixed app banks;</li>
<li>ReadyOS can eventually support more app catalog entries, with an
initial target of up to <code>64</code>;</li>
<li>future app/service invocation has reserved design space for
REU-backed request/result data, including headless calls and modal UI
service calls such as shared file open/save dialogs;</li>
<li>all changes are proven against before/after code size, BSS,
heap/headroom, overlay, micromodule, suspend/resume, and launcher/shim
behavior.</li>
</ul>
<p>This document is now both the plan and the source-of-truth
implementation tracker for the REU enhancement refactor. Completed
implementation status is recorded explicitly; future design notes remain
design notes until marked implemented here.</p>
<h2 id="current-plan-status-2026-06-06">Current Plan Status
2026-06-06</h2>
<p>This is the current source-of-truth checkpoint after the physical
REU-size authority work, full disk VICE regression, and full
EasyFlash/cartridge VICE regression.</p>
<p>Implemented and verified:</p>
<ul>
<li>logical REU bank <code>0</code> is the ReadyOS control bank
(<code>RCB0</code> schema version <code>4</code>);</li>
<li>the resident <code>$C600-$C9FF</code> shim-adjacent region remains
the same <code>1KB</code> shape:
<ul>
<li><code>$C600-$C6FF</code>: hot 256-byte bank allocation/type
table;</li>
<li><code>$C700-$C7FF</code>: existing resident system metadata/reserved
area;</li>
<li><code>$C800-$C9FF</code>: 512-byte resident shim;</li>
</ul></li>
<li>the resident shim remains exactly <code>512</code> bytes;</li>
<li>shim app-token lookup uses the bounded bank <code>0</code> byte
lookup page instead of fixed reserved app slots;</li>
<li>app snapshots are allocated lazily/dynamically instead of being
preallocated into fixed reserved <code>R</code> banks;</li>
<li>the launcher supports 64-entry catalogs without keeping full catalog
text in C64 RAM;</li>
<li>disk <code>apps.cfg</code> and <code>app.*</code> manifests support
explicit dependency/resource lines for the concrete known resource sets
currently implemented;</li>
<li>ReadyShell overlay cache banks, state/scratch bank, CAT staging, and
diagnostic/probe bytes are loader-owned dynamic resources rather than
fixed <code>$40/$41/$42/$43/$48</code> banks;</li>
<li>ReadyShell consumes small generated runtime metadata for overlay
bank/offset lookup instead of linking the full registry machinery;</li>
<li>ReadyBASIC core/code/module resource banks are
launcher/cartridge-assigned resources rather than fixed slots;</li>
<li>launcher-owned unload frees app snapshots and launcher-owned
resource banks;</li>
<li>launcher-owned unload also frees owner-recorded app-owned runtime
allocation banks (<code>REU_APP_ALLOC</code>) for apps that opt into the
owned-allocation micromodule;</li>
<li>REU Viewer reads bank <code>0</code> relationship metadata and can
describe app snapshots, resource owners, overlays/modules, and
unavailable physical banks;</li>
<li>physical REU size is launcher-owned:
<ul>
<li>launcher probes once at startup;</li>
<li>unavailable physical tail banks are marked <code>REU_UNAVAIL</code>
in <code>$C600-$C6FF</code>;</li>
<li>bank <code>0</code> header publishes encoded physical bank count and
first unavailable bank;</li>
<li>REU Viewer consumes the launcher-published physical size and no
longer reports impossible totals such as <code>211/128</code>;</li>
</ul></li>
<li>EasyFlash/cartridge metadata is generated from the same effective
resource layout and passed the cartridge-specific loader/preload
regression paths.</li>
</ul>
<p>Most recent verification pass:</p>
<ul>
<li><code>python3 build_support/verify_reu_control_bank.py</code>;</li>
<li><code>python3 build_support/verify_dynamic_launcher.py</code>;</li>
<li><code>git diff --check</code>;</li>
<li>regular ReadyBASIC VICE suites:
<code>READYBASIC_VISIBLE=0 READYBASIC_KEEP_VICE=0 make readybasic-vice-suites</code>;</li>
<li>regular ReadyShell VICE:
<code>READYSHELL_VISIBLE=0 build_support/run_readyshell_cross_app_resume_probe.sh</code>;</li>
<li>full EasyFlash/cartridge VICE suites:
<code>READYBASIC_VISIBLE=0 READYBASIC_KEEP_VICE=0 READYSHELL_VISIBLE=0 make easyflash-vice-suites</code>.</li>
</ul>
<p>Current memory discipline result:</p>
<ul>
<li>normal apps do not link the bank <code>0</code> writer or the
physical REU alias probe;</li>
<li>launcher and REU Viewer intentionally pay the registry/display
cost;</li>
<li>physical-size detection adds one launcher BSS byte and no REU Viewer
BSS;</li>
<li>ReadyBASIC remains the tightest app-window contract and must
continue to be protected from shared-library growth.</li>
</ul>
<p>Still left in the plan:</p>
<ul>
<li>generic arbitrary dependency loading for unknown app-specific
overlays or modules beyond the concrete <code>rsovl</code> and
<code>rbcore</code> resource contracts;</li>
<li>generic future resource-set ownership records for arbitrary
plugin/module systems beyond the implemented owner-recorded
<code>REU_APP_ALLOC</code> path;</li>
<li>a checked-in REU Viewer VICE regression that navigates selected
banks and asserts visible owner/detail text, beyond the focused
screenshot probes and static schema checks already run;</li>
<li>a C64-side or otherwise reliable runtime bank <code>0</code>
validator that reads the <code>RCB0</code> header/table/resource records
directly from REU during VICE automation;</li>
<li>headless app/service invocation records and dispatcher;</li>
<li>modal UI service invocation, including the future shared file
open/save service path;</li>
<li>service-temp resource cleanup semantics for those future service
flows;</li>
<li>possible future schema cleanup of historical reserved/overlapping
areas once the current v4 layout has stayed stable across more feature
work.</li>
</ul>
<h2 id="implementation-status-2026-06-04">Implementation Status
2026-06-04</h2>
<p>Completed in branch <code>codex/reu-control-bank-refactor</code>
after the v2 registry checkpoint:</p>
<ul>
<li>logical REU bank <code>0</code> mirror schema advanced to
<code>RCB0</code>, version <code>3</code>;</li>
<li>the hot app registry remains array-shaped and cheap to copy:
<ul>
<li><code>$0300</code>: 64-entry app-state arrays;</li>
<li><code>$0500</code>: compact app filename/token records;</li>
<li><code>$0900</code>: per-app resource-bank arrays;</li>
</ul></li>
<li>richer loader-owned relationship metadata now lives outside the hot
copy path:
<ul>
<li><code>$0A00</code>: 64 compact 16-byte resource/file records
containing app owner, resource set, resource kind, physical bank,
offset, length, flags, next index, overlay slot, source drive, and a
short name tag;</li>
<li><code>$0E00</code>: 64 fixed 128-byte dependency/source lines copied
from disk <code>apps.cfg</code> or <code>app.*</code> manifests;</li>
</ul></li>
<li>the disk launcher no longer hard-codes the ReadyShell overlay file
table, bank ordinal table, or slot offsets. ReadyShell
<code>rsovl+</code> placement is read from the dependency line using
<code>name@resourceBankOrdinal:offset</code>;</li>
<li>shipped disk catalogs and manifests now carry the explicit
ReadyShell packing line:</li>
</ul>
<pre class="text"><code>rsparser@0:0000,rsvm@0:3800,rsdrvilst@0:7000,rsldv@1:0000,rsstv@0:a800,rsfops@1:3800,rscat@1:7000,rscopy@1:a800,rsedit@2:0000</code></pre>
<ul>
<li>the launcher still owns allocation/unload policy. On load it writes
rich resource records for ReadyShell overlays and ReadyBASIC module
banks; on unload it clears records for the app before freeing those
banks;</li>
<li>apps that need runtime <code>REU_APP_ALLOC</code> banks can opt into
the separate <code>reu_owned_alloc</code> micromodule. It writes strict
<code>REUCB_DEP_KIND_APP_ALLOC</code> records in the <code>$0A00</code>
rich-resource table with owner app id, slot id, physical bank, and a
four-character tag. The primitive <code>reu_mgr_alloc.c</code> allocator
remains small for apps that do not need owner metadata;</li>
<li>launcher unload now also frees owner-recorded
<code>REU_APP_ALLOC</code> banks when the selected app is unloaded. The
resident shim remains unchanged; this is launcher plus global REU bank
<code>0</code> policy;</li>
<li>REU Viewer displays app-owned runtime banks as
<code>APP ALLOC</code> and uses the owner record to show the owning app
plus tag, for example QuickNotes note banks tagged
<code>NOTE</code>;</li>
<li>ReadyShell consumes only the small v4 <code>OV</code> metadata block
with nine <code>(bank, offset)</code> records. That keeps ReadyShell
from linking the larger registry machinery;</li>
<li>EasyFlash remains generated/static at build time, but now writes the
same v4 ReadyShell metadata shape and mirrors equivalent rich resource
records into bank <code>0</code>;</li>
<li>REU Viewer now uses the bank <code>0</code> metadata to show whether
the selected bank is an app snapshot, which app slot/name owns it, or
which overlay/module record is stored in it;</li>
<li>static verifiers now reject:
<ul>
<li>a launcher-side return to hard-coded ReadyShell overlay
placement;</li>
<li>dependency writers that erase the source line when the source is the
launcher dependency buffer;</li>
<li>schema regressions in the v3 bank <code>0</code> rich-record
layout;</li>
<li>EasyFlash v4 ReadyShell metadata verifier drift.</li>
</ul></li>
</ul>
<p>Final measured v3 rich-registry impact against the accepted v2 bank-0
registry baseline:</p>
<table>
<thead>
<tr>
<th>App</th>
<th style="text-align: right;">Before</th>
<th style="text-align: right;">Final</th>
<th style="text-align: right;">Delta</th>
</tr>
</thead>
<tbody>
<tr>
<td>launcher</td>
<td style="text-align: right;">3583</td>
<td style="text-align: right;">1009</td>
<td style="text-align: right;">-2574</td>
</tr>
<tr>
<td>editor</td>
<td style="text-align: right;">11712</td>
<td style="text-align: right;">11712</td>
<td style="text-align: right;">0</td>
</tr>
<tr>
<td>quicknotes</td>
<td style="text-align: right;">9518</td>
<td style="text-align: right;">9518</td>
<td style="text-align: right;">0</td>
</tr>
<tr>
<td>calcplus</td>
<td style="text-align: right;">6715</td>
<td style="text-align: right;">6715</td>
<td style="text-align: right;">0</td>
</tr>
<tr>
<td>hexview</td>
<td style="text-align: right;">32399</td>
<td style="text-align: right;">32399</td>
<td style="text-align: right;">0</td>
</tr>
<tr>
<td>clipmgr</td>
<td style="text-align: right;">13561</td>
<td style="text-align: right;">13561</td>
<td style="text-align: right;">0</td>
</tr>
<tr>
<td>reuviewer</td>
<td style="text-align: right;">29572</td>
<td style="text-align: right;">28781</td>
<td style="text-align: right;">-791</td>
</tr>
<tr>
<td>sysinfo</td>
<td style="text-align: right;">30021</td>
<td style="text-align: right;">30021</td>
<td style="text-align: right;">0</td>
</tr>
<tr>
<td>tasklist</td>
<td style="text-align: right;">6069</td>
<td style="text-align: right;">6069</td>
<td style="text-align: right;">0</td>
</tr>
<tr>
<td>simplefiles</td>
<td style="text-align: right;">12636</td>
<td style="text-align: right;">12636</td>
<td style="text-align: right;">0</td>
</tr>
<tr>
<td>game2048</td>
<td style="text-align: right;">28580</td>
<td style="text-align: right;">28580</td>
<td style="text-align: right;">0</td>
</tr>
<tr>
<td>deminer</td>
<td style="text-align: right;">22167</td>
<td style="text-align: right;">22167</td>
<td style="text-align: right;">0</td>
</tr>
<tr>
<td>cal26</td>
<td style="text-align: right;">8751</td>
<td style="text-align: right;">8751</td>
<td style="text-align: right;">0</td>
</tr>
<tr>
<td>dizzy</td>
<td style="text-align: right;">1834</td>
<td style="text-align: right;">1834</td>
<td style="text-align: right;">0</td>
</tr>
<tr>
<td>readyirc</td>
<td style="text-align: right;">29006</td>
<td style="text-align: right;">29006</td>
<td style="text-align: right;">0</td>
</tr>
<tr>
<td>rirc-rrnet</td>
<td style="text-align: right;">18220</td>
<td style="text-align: right;">18220</td>
<td style="text-align: right;">0</td>
</tr>
<tr>
<td>readybasic</td>
<td style="text-align: right;">1029</td>
<td style="text-align: right;">1029</td>
<td style="text-align: right;">0</td>
</tr>
<tr>
<td>readme</td>
<td style="text-align: right;">22748</td>
<td style="text-align: right;">22748</td>
<td style="text-align: right;">0</td>
</tr>
<tr>
<td>readyshell</td>
<td style="text-align: right;">18660</td>
<td style="text-align: right;">18327</td>
<td style="text-align: right;">-333</td>
</tr>
</tbody>
</table>
<p>Interpretation: normal apps and ReadyBASIC do not pay for the rich
bank <code>0</code> registry. The cost is concentrated in the launcher,
which owns parse/load/unload policy, and REU Viewer, which displays the
relationship data. ReadyShell pays 333 bytes for consuming dynamic
bank/offset overlay metadata while still avoiding the large registry
writer.</p>
<p>Verification completed for this v3 checkpoint:</p>
<ul>
<li><code>python3 -m py_compile build_support/build_apps_catalog_petscii.py build_support/readyos_easyflash.py build_support/verify_reu_control_bank.py build_support/verify_dynamic_launcher.py build_support/vice_easyflash_smoke.py verify.py</code>;</li>
<li><code>python3 build_support/verify_reu_control_bank.py</code>;</li>
<li><code>python3 build_support/verify_dynamic_launcher.py</code>;</li>
<li><code>make verify</code>;</li>
<li><code>make readyshell-host-tests</code>;</li>
<li><code>READYSHELL_VISIBLE=0 build_support/run_readyshell_cross_app_resume_probe.sh</code>;</li>
<li><code>make easyflash-verify</code>.</li>
</ul>
<p>The EasyFlash smoke now verifies the full 36-byte v4 overlay metadata
region at <code>$C760-$C783</code>, including multi-line VICE monitor
dumps. Earlier verifier logic only compared the first 16-byte monitor
row and was corrected.</p>
<p>ReadyBASIC headless VICE suite status for this checkpoint is tracked
in <code>agentworking/reu_rich_registry_working_notes.md</code> and
should be kept current with the final command result before the branch
is merged.</p>
<h2 id="physical-reu-size-authority-checkpoint-2026-06-06">Physical REU
Size Authority Checkpoint 2026-06-06</h2>
<p>This checkpoint makes physical REU size a launcher-owned system fact
instead of a REU Viewer local probe. The practical bug it fixes is the
8MB case where the resident table correctly had unavailable banks but
REU Viewer still counted past the physical end and could report
impossible totals such as <code>211/128</code> free banks.</p>
<p>Implemented:</p>
<ul>
<li>logical REU bank <code>0</code> mirror schema advanced to
<code>RCB0</code>, version <code>4</code>;</li>
<li>the resident <code>$C600-$C6FF</code> allocation table remains the
hot 256-byte bank classification table, but the launcher now probes
physical REU size during <code>launcher_init()</code> before
app/resource allocation;</li>
<li>banks beyond the detected physical end are marked
<code>REU_UNAVAIL</code> (<code>0x0A</code>) in
<code>$C600-$C6FF</code>;</li>
<li>the existing bank <code>0</code> mirror at <code>$0100-$01FF</code>
receives those unavailable markers just like any other hot table
state;</li>
<li>the <code>RCB0</code> header publishes the encoded physical bank
count at byte <code>44</code>, the first unavailable bank at byte
<code>45</code>, and feature flags at byte <code>46</code>;</li>
<li>the encoding remains one byte: <code>0</code> means <code>256</code>
physical banks, otherwise the byte value is the physical bank count and
first unavailable bank;</li>
<li>REU Viewer no longer probes or writes REU just to discover size. It
reads the launcher-published header byte when bank <code>0</code> is
valid, with a table-derived fallback only for broken/missing
control-bank state;</li>
<li>EasyFlash static preload marking now respects
<code>REU_UNAVAIL</code>, so cartridge generated resource banks cannot
accidentally overwrite unavailable physical slots in smaller REU
configurations.</li>
</ul>
<p>Shim and resident-memory status:</p>
<ul>
<li>no shim code or shim ABI byte changed in this checkpoint;</li>
<li>the <code>$C800-$C9FF</code> resident shim remains exactly
<code>512</code> bytes;</li>
<li>the full shim-adjacent resident region remains the same
<code>1KB</code>:
<ul>
<li><code>$C600-$C6FF</code>: 256-byte bank allocation/type table;</li>
<li><code>$C700-$C7FF</code>: existing system metadata/reserved
bytes;</li>
<li><code>$C800-$C9FF</code>: 512-byte resident shim;</li>
</ul></li>
<li>no new resident table was added. The physical-size fact is
represented by existing <code>REU_UNAVAIL</code> entries in
<code>$C600-$C6FF</code> plus three header bytes in logical REU bank
<code>0</code>.</li>
</ul>
<p>Micromodule split:</p>
<ul>
<li><code>src/lib/reu_phys.c</code> is the tiny shared table-policy
helper linked by the launcher, REU Viewer, and control-bank writer;</li>
<li><code>src/lib/reu_phys_probe.c</code> is linked by the launcher
only. This keeps the alias-probe code and its one-byte BSS scratch out
of REU Viewer and normal apps;</li>
<li><code>src/lib/reu_control_bank.c</code> derives the published
physical count from the allocation table when writing the
<code>RCB0</code> header.</li>
</ul>
<p>Measured app-window impact against the pre-checkpoint snapshots in
<code>agentworking/reu_physical_size_headroom_before.json</code> and
<code>agentworking/reu_physical_size_easyflash_headroom_before.json</code>:</p>
<table>
<thead>
<tr>
<th>App</th>
<th style="text-align: right;">Before</th>
<th style="text-align: right;">Final</th>
<th style="text-align: right;">Delta</th>
<th style="text-align: right;">CODE</th>
<th style="text-align: right;">RODATA</th>
<th style="text-align: right;">DATA</th>
<th style="text-align: right;">BSS</th>
</tr>
</thead>
<tbody>
<tr>
<td>launcher</td>
<td style="text-align: right;">5861</td>
<td style="text-align: right;">5374</td>
<td style="text-align: right;">-487</td>
<td style="text-align: right;">+486</td>
<td style="text-align: right;">0</td>
<td style="text-align: right;">0</td>
<td style="text-align: right;">+1</td>
</tr>
<tr>
<td>launcher_easyflash</td>
<td style="text-align: right;">18209</td>
<td style="text-align: right;">17757</td>
<td style="text-align: right;">-452</td>
<td style="text-align: right;">+451</td>
<td style="text-align: right;">0</td>
<td style="text-align: right;">0</td>
<td style="text-align: right;">+1</td>
</tr>
<tr>
<td>reuviewer</td>
<td style="text-align: right;">29540</td>
<td style="text-align: right;">29411</td>
<td style="text-align: right;">-129</td>
<td style="text-align: right;">+131</td>
<td style="text-align: right;">0</td>
<td style="text-align: right;">0</td>
<td style="text-align: right;">-2</td>
</tr>
</tbody>
</table>
<p>Interpretation: the only BSS cost is the launcher probe byte. REU
Viewer pays small CODE for displaying the system-owned size but drops
its local probe scratch. Normal apps do not link either physical-size
module.</p>
<p>Focused verification/screenshot evidence before full slow
regression:</p>
<ul>
<li>static control-bank verifier updated for schema <code>4</code> and
the physical-size module split;</li>
<li>8MB VICE run <code>logs/vice_auto_20260606_193409</code> showed
<code>PHYS:128</code>, <code>FREE:83</code>, <code>CB:OK</code>, and
banks <code>$80-$FF</code> displayed as unavailable;</li>
<li>16MB VICE run <code>logs/vice_auto_20260606_193505</code> showed
<code>PHYS:256</code>, <code>FREE:211</code>, and no unavailable
physical tail.</li>
</ul>
<p>Full regression verification completed after the checkpoint:</p>
<ul>
<li><code>python3 build_support/verify_reu_control_bank.py</code>;</li>
<li><code>python3 build_support/verify_dynamic_launcher.py</code>;</li>
<li><code>git diff --check</code>;</li>
<li>regular ReadyBASIC VICE suites via
<code>READYBASIC_VISIBLE=0 READYBASIC_KEEP_VICE=0 make readybasic-vice-suites</code>;</li>
<li>regular ReadyShell VICE probe via
<code>READYSHELL_VISIBLE=0 build_support/run_readyshell_cross_app_resume_probe.sh</code>;</li>
<li>full EasyFlash/cartridge VICE suites via
<code>READYBASIC_VISIBLE=0 READYBASIC_KEEP_VICE=0 READYSHELL_VISIBLE=0 make easyflash-vice-suites</code>.</li>
</ul>
<p>The cartridge run generated EasyFlash plans from the regular plans
and passed the ReadyBASIC demo, repeat/label, lifecycle, module overlay,
plugin command, program, <code>rbtest1</code>, minimal resume, screen
REU temp, state, large-vars, cross-app resume, second-entry/editor, full
visual verification, and ReadyShell cross-app/CAT probes. This is the
current proof point that both disk and cartridge SKUs honor the same
physical-size/unavailable-tail contract.</p>
<h2 id="app-owned-runtime-allocation-checkpoint-2026-06-07">App-Owned
Runtime Allocation Checkpoint 2026-06-07</h2>
<p>This checkpoint adds ownership tracking for app-requested
<code>REU_APP_ALLOC</code> banks without adding shim code and without
making the primitive allocator heavier for apps that do not need
ownership records.</p>
<p>Implemented:</p>
<ul>
<li>added <code>src/lib/reu_owned_alloc.c</code> /
<code>src/lib/reu_owned_alloc.h</code> as an optional micromodule
layered over <code>reu_mgr_alloc.c</code>;</li>
<li>the primitive allocator remains the small common implementation.
Apps link the owned allocator only when they need bank <code>0</code>
ownership records;</li>
<li>QuickNotes now records its two note-storage banks with slot ids
<code>1</code> and <code>2</code> and tag <code>NOTE</code>;</li>
<li>ReadyIRC and rirc-rrnet now record their scrollback banks with slot
id <code>1</code> and tag <code>SCRL</code>;</li>
<li>owner records use <code>REUCB_DEP_KIND_APP_ALLOC</code> in the
<code>$0A00</code> rich-resource table and carry app id, slot id,
physical bank, and a four-character tag;</li>
<li>allocation is strict: if the owner record cannot be written, the
newly allocated bank is immediately freed and allocation fails;</li>
<li>launcher unload scans the rich-resource table for the selected app
and frees matching banks only when the hot allocation table still marks
the bank as <code>REU_APP_ALLOC</code>, preventing stale metadata from
freeing the wrong type;</li>
<li>REU Viewer displays owner-recorded runtime banks as
<code>APP ALLOC</code> with the owning app and tag.</li>
</ul>
<p>Shim and resident-memory status:</p>
<ul>
<li>no shim code or shim ABI byte changed;</li>
<li>the <code>$C800-$C9FF</code> resident shim remains exactly
<code>512</code> bytes;</li>
<li>the <code>$C600-$C9FF</code> shim-adjacent resident region remains
the same <code>1KB</code>;</li>
<li>all relationship detail lives in logical REU bank <code>0</code>,
not in new resident tables.</li>
</ul>
<p>Measured app-window impact against
<code>agentworking/reu_owned_alloc_headroom_before.json</code>:</p>
<table>
<thead>
<tr>
<th>App</th>
<th style="text-align: right;">Before</th>
<th style="text-align: right;">After</th>
<th style="text-align: right;">Delta</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td>launcher</td>
<td style="text-align: right;">5387</td>
<td style="text-align: right;">5242</td>
<td style="text-align: right;">-145</td>
<td>unload scan for owner-recorded app allocations</td>
</tr>
<tr>
<td>quicknotes</td>
<td style="text-align: right;">9851</td>
<td style="text-align: right;">9164</td>
<td style="text-align: right;">-687</td>
<td>links owned allocator for note banks</td>
</tr>
<tr>
<td>readyirc</td>
<td style="text-align: right;">29339</td>
<td style="text-align: right;">28657</td>
<td style="text-align: right;">-682</td>
<td>links owned allocator for scrollback</td>
</tr>
<tr>
<td>rirc-rrnet</td>
<td style="text-align: right;">18553</td>
<td style="text-align: right;">17871</td>
<td style="text-align: right;">-682</td>
<td>links owned allocator for scrollback</td>
</tr>
<tr>
<td>reuviewer</td>
<td style="text-align: right;">29523</td>
<td style="text-align: right;">29454</td>
<td style="text-align: right;">-69</td>
<td>displays app-allocation tag details</td>
</tr>
<tr>
<td>editor</td>
<td style="text-align: right;">11768</td>
<td style="text-align: right;">11768</td>
<td style="text-align: right;">0</td>
<td>no link impact</td>
</tr>
<tr>
<td>readybasic</td>
<td style="text-align: right;">1029</td>
<td style="text-align: right;">1029</td>
<td style="text-align: right;">0</td>
<td>no link impact</td>
</tr>
<tr>
<td>readyshell</td>
<td style="text-align: right;">18185</td>
<td style="text-align: right;">18185</td>
<td style="text-align: right;">0</td>
<td>no link impact</td>
</tr>
</tbody>
</table>
<p>Verification completed:</p>
<ul>
<li><code>make verify</code>;</li>
<li><code>READYBASIC_VISIBLE=0 READYBASIC_KEEP_VICE=0 make readybasic-vice-suites</code>;</li>
<li><code>QUICKNOTES_OWNED_REU_VISIBLE=0 QUICKNOTES_OWNED_REU_KEEP_VICE=0 make quicknotes-owned-reu-vice</code>;</li>
<li><code>LAUNCHER_REU_STATE_SKIP_BUILD=1 LAUNCHER_REU_STATE_VISIBLE=0 build_support/run_launcher_reu_state_probe.sh</code>;</li>
<li><code>READYSHELL_VISIBLE=0 build_support/run_readyshell_cross_app_resume_probe.sh</code>;</li>
<li><code>make easyflash-smoke</code>;</li>
<li><code>READYSHELL_VISIBLE=0 make easyflash-readyshell-vice-suites</code>;</li>
<li><code>git diff --check</code>.</li>
</ul>
<p>Focused QuickNotes evidence:</p>
<ul>
<li>before unload run: <code>logs/vice_auto_20260607_173802</code>;</li>
<li>after unload run: <code>logs/vice_auto_20260607_173831</code>;</li>
<li>the before run asserted QuickNotes-owned banks in the hot allocation
table and REU Viewer displayed <code>APP ALLOC</code>,
<code>OWNER: QUICKNOTES</code>, and <code>TAG NOTE</code>;</li>
<li>the after run unloaded QuickNotes, asserted those hot-table entries
were free, and REU Viewer displayed the former bank as
<code>TYPE: FREE</code>.</li>
</ul>
<h2 id="reu-bank-0-lookup-checkpoint-2026-06-06">REU Bank-0 Lookup
Checkpoint 2026-06-06</h2>
<p>This checkpoint removes the remaining false "reserved app slot" pool
from the runtime REU map and moves shim-facing app-token resolution into
logical REU bank <code>0</code>.</p>
<p>Implemented:</p>
<ul>
<li>2026-06-07 update: the unused launcher overlay bank reservation was
removed. <code>skip+2</code> is now the first dynamic/resource
allocation bank, logical bank <code>1</code> can map to
<code>skip+2</code>, and the launcher keeps only its <code>skip+1</code>
snapshot/resume bank.</li>
<li>logical app snapshot tokens still use the same one-byte ABI passed
through <code>$C820</code>, <code>$C834</code>, and the
hotkey/suspend/resume paths;</li>
<li>the resident shim no longer computes app physical banks as
<code>skip + 1 + token</code>. For non-zero tokens,
<code>reu_setup_logical</code> fetches one byte from logical bank
<code>0</code> at <code>$2F00 + token</code> into <code>$C83D</code>,
then jumps to the existing physical-bank setup helper at
<code>$C9A0</code>;</li>
<li>token <code>0</code> remains the launcher snapshot and still
resolves directly to <code>skip + 1</code>, so boot/preload launcher
restore does not depend on the lookup page;</li>
<li>the control-bank writer publishes the 256-byte shim lookup page at
<code>$2F00-$2FFF</code>. Current entries use the compact physical
formula (<code>token 1 -> skip + 2</code>, etc.) when no explicit
override is present, but the authority is now in REU bank
<code>0</code>;</li>
<li><code>REU_FIRST_DYNAMIC_PHYSICAL()</code> now starts at
<code>skip + 2</code>, immediately after ReadyOS global and launcher
snapshot banks;</li>
<li>bitmap sync no longer repopulates <code>REU_RESERVED</code>
placeholders for clear low-token app bits. Existing old
<code>REU_RESERVED</code> entries are collapsed to
<code>REU_FREE</code>, while explicit launcher-owned
<code>REU_APP_STATE</code> allocations are preserved until launcher
unload/free clears them;</li>
<li>disk and EasyFlash resource-bank allocation now starts at the same
dynamic base and skips banks already marked used, rather than preserving
a hidden <code>skip+2..skip+25</code> gap;</li>
<li>the shim remains exactly <code>512</code> bytes. <code>$C83D</code>
is now the one-byte lookup scratch byte; <code>$C83E-$C83F</code> remain
reserved.</li>
</ul>
<p>Measured app-window headroom impact against the pre-checkpoint
snapshot in
<code>agentworking/reu_bank0_lookup_headroom_before.json</code>:</p>
<table>
<thead>
<tr>
<th>App</th>
<th style="text-align: right;">Before</th>
<th style="text-align: right;">After</th>
<th style="text-align: right;">Delta</th>
</tr>
</thead>
<tbody>
<tr>
<td>launcher</td>
<td style="text-align: right;">5953</td>
<td style="text-align: right;">5841</td>
<td style="text-align: right;">-112</td>
</tr>
<tr>
<td>editor</td>
<td style="text-align: right;">11730</td>
<td style="text-align: right;">11967</td>
<td style="text-align: right;">+237</td>
</tr>
<tr>
<td>quicknotes</td>
<td style="text-align: right;">9536</td>
<td style="text-align: right;">9773</td>
<td style="text-align: right;">+237</td>
</tr>
<tr>
<td>calcplus</td>
<td style="text-align: right;">6745</td>
<td style="text-align: right;">7170</td>
<td style="text-align: right;">+425</td>
</tr>
<tr>
<td>hexview</td>
<td style="text-align: right;">32429</td>
<td style="text-align: right;">32854</td>
<td style="text-align: right;">+425</td>
</tr>
<tr>
<td>clipmgr</td>
<td style="text-align: right;">13591</td>
<td style="text-align: right;">14016</td>
<td style="text-align: right;">+425</td>
</tr>
<tr>
<td>reuviewer</td>
<td style="text-align: right;">28827</td>
<td style="text-align: right;">29010</td>
<td style="text-align: right;">+183</td>
</tr>
<tr>
<td>tasklist</td>
<td style="text-align: right;">6087</td>
<td style="text-align: right;">6324</td>
<td style="text-align: right;">+237</td>
</tr>
<tr>
<td>cal26</td>
<td style="text-align: right;">8769</td>
<td style="text-align: right;">9006</td>
<td style="text-align: right;">+237</td>
</tr>
<tr>
<td>readyirc</td>
<td style="text-align: right;">29024</td>
<td style="text-align: right;">29261</td>
<td style="text-align: right;">+237</td>
</tr>
<tr>
<td>rirc-rrnet</td>
<td style="text-align: right;">18238</td>
<td style="text-align: right;">18475</td>
<td style="text-align: right;">+237</td>
</tr>
</tbody>
</table>
<p>Interpretation: the launcher pays 112 bytes for the lookup-page
writer/mirror path. Apps that link the split REU allocation helper
recover 183-425 bytes because the old "free low app slot but preserve
reserved placeholder" code path was removed. ReadyBASIC and ReadyShell
app-window headroom did not materially move in this checkpoint.</p>
<p>Verification completed:</p>
<ul>
<li><code>python3 build_support/verify_readyos_shim.py</code>;</li>
<li><code>python3 build_support/verify_dynamic_launcher.py</code>;</li>
<li><code>python3 build_support/verify_memory_map.py</code>;</li>
<li><code>bash run.sh --build-all</code>.</li>
</ul>
<h2
id="readyshell-state-bank-diagnosticcat-checkpoint-2026-06-06">ReadyShell
State-Bank Diagnostic/CAT Checkpoint 2026-06-06</h2>
<p>This checkpoint retires ReadyShell's last fixed <code>$43</code> REU
dependency without adding a new bank, new shim ABI, or a launcher-side
special case for CAT.</p>
<p>Implemented:</p>
<ul>
<li><code>REU_RS_DEBUG</code> and <code>REU_BANK_RS_DEBUG</code> were
removed from the REU manager contract, allocator fixed-bank filters,
bank-0 control-bank seed records, and memory-map verifier inputs;</li>
<li>ReadyShell's one-byte REU availability probe now uses the
loader-assigned ReadyShell state bank, at relative offset
<code>+$7FFF</code>, instead of fixed bank <code>$43</code>;</li>
<li>the overlay debug/verification ring moved into the tail of the same
ReadyShell state bank:
<ul>
<li>debug head: <code>+$7DE0</code>;</li>
<li>debug data: <code>+$7DF0-+$7FEF</code>;</li>
<li>probe byte: <code>+$7FFF</code>;</li>
</ul></li>
<li>the generic ReadyShell command scratch window now ends at
<code>+$7DDF</code>, reserving the <code>+$7DE0-+$7FFF</code> diagnostic
tail;</li>
<li>CAT no longer stages data in fixed <code>$43D800</code>. It uses the
existing command-scratch base, exactly like LST/LDV/STV/PUT/ADD, and
remains safe because ReadyShell command overlays execute serially
through one live overlay window;</li>
<li>REU Viewer now reports the loader-assigned ReadyShell state/scratch
bank as <code>T</code> instead of showing a misleading fixed
<code>D</code> debug bank;</li>
<li>generated ReadyShell overlay inventory docs now compute diagnostic
placement from the state-bank-relative constants, so disk and cartridge
generated-bank layouts remain accurate.</li>
</ul>
<p>Current ReadyShell state-bank layout:</p>
<pre class="text"><code>$0000-$7DDF shared transient command scratch
$0000-$17FF CAT staging while CAT is active
$7DE0-$7FFF diagnostics/probe tail
$8000-$80FF heap metadata / command registry block
$80F0-$8113 shared ReadyShell overlay metadata
$8114 pause flag
$8120-$FEFF persistent REU value arena
$FF00-$FFFF unused tail</code></pre>
<p>Intentional capacity tradeoff:</p>
<ul>
<li>generic command scratch: <code>32768</code> -> <code>32224</code>
bytes (<code>-544</code>);</li>
<li>CAT is unchanged at its existing <code>6144</code> byte staging
envelope, because it only uses the front of scratch while active;</li>
<li>the ReadyShell value arena remains <code>32224</code> bytes;</li>
<li>the shim remains exactly <code>512</code> bytes and does not learn
about this placement.</li>
</ul>
<p>Measured app-window headroom impact against
<code>agentworking/readyshell_statebank_debug_cat_headroom_before.json</code>:</p>
<table>
<thead>
<tr>
<th>App</th>
<th style="text-align: right;">Before</th>
<th style="text-align: right;">After</th>
<th style="text-align: right;">Delta</th>
</tr>
</thead>
<tbody>
<tr>
<td>launcher</td>
<td style="text-align: right;">5841</td>
<td style="text-align: right;">5861</td>
<td style="text-align: right;">+20</td>
</tr>
<tr>
<td>editor</td>
<td style="text-align: right;">11967</td>
<td style="text-align: right;">11999</td>
<td style="text-align: right;">+32</td>
</tr>
<tr>
<td>quicknotes</td>
<td style="text-align: right;">9773</td>
<td style="text-align: right;">9805</td>
<td style="text-align: right;">+32</td>
</tr>
<tr>
<td>calcplus</td>
<td style="text-align: right;">7170</td>
<td style="text-align: right;">7219</td>
<td style="text-align: right;">+49</td>
</tr>
<tr>
<td>hexview</td>
<td style="text-align: right;">32854</td>
<td style="text-align: right;">32903</td>
<td style="text-align: right;">+49</td>
</tr>
<tr>
<td>clipmgr</td>
<td style="text-align: right;">14016</td>
<td style="text-align: right;">14065</td>
<td style="text-align: right;">+49</td>
</tr>
<tr>
<td>reuviewer</td>
<td style="text-align: right;">29010</td>
<td style="text-align: right;">29073</td>
<td style="text-align: right;">+63</td>
</tr>
<tr>
<td>tasklist</td>
<td style="text-align: right;">6324</td>
<td style="text-align: right;">6356</td>
<td style="text-align: right;">+32</td>
</tr>
<tr>
<td>cal26</td>
<td style="text-align: right;">9006</td>
<td style="text-align: right;">9038</td>
<td style="text-align: right;">+32</td>
</tr>
<tr>
<td>readyirc</td>
<td style="text-align: right;">29261</td>
<td style="text-align: right;">29293</td>
<td style="text-align: right;">+32</td>
</tr>
<tr>
<td>rirc-rrnet</td>
<td style="text-align: right;">18475</td>
<td style="text-align: right;">18507</td>
<td style="text-align: right;">+32</td>
</tr>
<tr>
<td>readyshell</td>
<td style="text-align: right;">18207</td>
<td style="text-align: right;">18185</td>
<td style="text-align: right;">-22</td>
</tr>
</tbody>
</table>
<p>Interpretation: ReadyShell pays 22 bytes of resident app-window
headroom for state-bank-relative diagnostics/probe access. REU manager
consumers recover small amounts because the retired fixed debug-bank
type no longer participates in fixed-bank filtering and viewer display
logic.</p>
<p>Verification for this checkpoint must include a ReadyShell VICE CAT
probe using the shipped <code>RSHELP</code> SEQ file, plus the normal
regular and cartridge VICE suites. The generated cross-app ReadyShell
probe now runs:</p>
<pre class="text"><code>VER
LST "RSHELP"
VER
CAT "RSHELP" ! TOP 1
VER</code></pre>
<p>Regular ReadyShell CAT/cross-app probe status:</p>
<ul>
<li><code>READYSHELL_SKIP_BUILD=1 READYSHELL_VISIBLE=0 build_support/run_readyshell_cross_app_resume_probe.sh</code>
passed on 2026-06-06;</li>
<li>run artifact: <code>logs/vice_auto_20260606_144857</code>;</li>
<li>captured screen confirms <code>CAT "RSHELP" ! TOP 1</code> prints
<code>READYSHELL QUICK REF</code> and returns to <code>VER</code>.</li>
</ul>
<p>Regular and cartridge suite status for this checkpoint:</p>
<ul>
<li><code>READYBASIC_VISIBLE=0 READYBASIC_KEEP_VICE=0 make readybasic-vice-suites</code>
passed on 2026-06-06. Notable artifacts include
<code>logs/vice_auto_20260606_150934</code> for the 211-step regular
ReadyBASIC cross-app resume probe and
<code>logs/vice_auto_20260606_151405</code> for the 184-step regular
full-suite visual verification.</li>
<li><code>READYBASIC_VISIBLE=0 READYBASIC_KEEP_VICE=0 READYSHELL_VISIBLE=0 make easyflash-vice-suites</code>
passed on 2026-06-06. Notable artifacts include
<code>logs/vice_auto_20260606_154237</code> for the 213-step EasyFlash
ReadyBASIC cross-app resume probe,
<code>logs/vice_auto_20260606_154716</code> for the 186-step EasyFlash
full-suite visual verification, and
<code>logs/vice_auto_20260606_155519</code> for the EasyFlash ReadyShell
cross-app probe with <code>VER</code>, <code>LST</code>,
<code>CAT "RSHELP" ! TOP 1</code>, and post-CAT <code>VER</code>.</li>
</ul>
<h2 id="cartridge-stabilization-checkpoint-2026-06-04">Cartridge
Stabilization Checkpoint 2026-06-04</h2>
<p>The cartridge SKU is now aligned with the same resource-ownership
pattern as the disk launcher without adding new shim ABI or teaching the
cartridge launcher a separate hard-coded resource contract.</p>
<p>Implemented cartridge-specific corrections:</p>
<ul>
<li>EasyFlash catalog generation emits ReadyShell overlay resource rows
from the same generated layout data used by the cartridge preload
image.</li>
<li>EasyFlash boot writes the 36-byte ReadyShell v4 <code>OV</code>
metadata block from its generated <code>OVERLAY_TABLE_RAM</code> values
into the generated ReadyShell state bank. The runtime metadata byte
order is the same as the disk launcher contract:
<code>(bank, offset_lo, offset_hi)</code>.</li>
<li>The EasyFlash launcher mirrors equivalent rich resource records into
logical bank <code>0</code>, so REU Viewer and later owner/unload
diagnostics see the same relationship shape even though cartridge
resources are generated/static.</li>
<li>ReadyShell still consumes only the tiny metadata block at offset
<code>$80F0</code> inside its loader-assigned state bank plus assigned
<code>(bank, offset)</code> values. It does not parse the bank
<code>0</code> registry and does not allocate or free its own overlay
cache/state banks.</li>
<li>ReadyBASIC cartridge first-entry startup now validates restored
BASIC runtime state before trusting it. If the hidden saved zero