Put the transport on the 68000, and find PIO costs 87 clocks a byte
ROADMAP P4b. src/player/xfer.i answers src/player/ring.i's XF_* mailbox with a real READ(10) to a real MB89352 in place of tools/bench/stream.lua's modelled transport: 120 records, 4,488,588 B, pixel-exact out of a 256 KB ring, with a real mid-stream seek in a second pass. The tiling is the SAME 18 wraps and 14.7 KB mean hole that 49.4's host producer and 55.4's modelled transport produced -- a third transport, same placement, which is the assertion that ring.i could not tell which side of the seam answered it. What it costs is the finding. tools/bench/xfer_cost.sh subtracts the same 120 frames run twice and gets 87.28 clocks per delivered byte, against the 68000's own cycle table for the loop, which says 87.15 -- 0.2% apart, so the cost is the instruction stream and not MAME's device model, and it is the first number this rig has produced that survives leaving the emulator. That is 391.8% of a 12 fps frame; the machine's own V-DISP clock agrees from the other end at 2.57 fps. Against the ladder, W=5 held is 22.4% of a frame and W=19 is 85.3%, so P4a is worth 4.6x the worst DMA configuration in this tree and 17.5x the best -- where before this session it was worth 9 against 19. W itself did not move by a clock. "UNDERRUNS: 0/120" is vacuous with a synchronous transport, and stream.lua now prints that argument next to the zero: a frame cannot start before its record has landed because the decoder IS the transport. The counter that means something is NO IDLE, 119/120 with a worst overrun of 441 whole ticks. Same class of error as 49.7.2's free-running ring passing at 48 KB. 58.3: a record is not a sector -- 117 of 120 start part way into one, and reading whole sectors into the ring corrupts the neighbours rather than wasting bytes (49.2, no bounds check). scsi.i reads the covering sectors and stores only the window, which is free in PIO and stops being free the moment P4a succeeds. tools/analysis/26_sector_align.py prices the three ways out and sector-aligned records win on both axes: +0.43% wire and zero clocks, against +1.34% and a bounce copy at +5 clk/B. ROADMAP now carries a four-item re-encode bundle and P4a should be attempted against a sector-aligned container. check.sh gains two stages and was ALL GREEN before and after. decode.bin is unchanged at 1,296 B and the same MD5. Claude-Session: https://claude.ai/code/session_01194oWYW8DQXK1SZ2DnChW6
This commit is contained in:
+65
-15
@@ -6,6 +6,8 @@ Amended end of session 22: P3 done (FINDINGS 54).
|
||||
Amended end of session 23: P5 done (FINDINGS 55).
|
||||
Amended end of session 24: G1 done (FINDINGS 56).
|
||||
Amended end of session 25: P4 HALF done (FINDINGS 57).
|
||||
Amended end of session 26: P4b done, P4a is the last open item before M2
|
||||
(FINDINGS 58).
|
||||
|
||||
**THE COMPLETION TARGET IS M3, THE VERTICAL SLICE** (USER DECISION): one scene
|
||||
tree — a decision point, two outcomes, a death clip — with audio, streaming from
|
||||
@@ -124,7 +126,18 @@ the words read back **out of the palette registers**. 9.70 ms per scene, plus
|
||||
**What is left is the other half of the sentence: reserve index 0 as black with
|
||||
`I = 0` (23.4).** That is ENCODER-side, it changes the container, and it moves
|
||||
every constant fitted to the gate container, so it is a re-encode plus a
|
||||
re-measurement rather than an edit. Until then the letterbox gets the palette's
|
||||
re-measurement rather than an edit.
|
||||
|
||||
**THE RE-ENCODE BUNDLE, collected here because it is now four items and they
|
||||
share one re-measurement.** Nothing below is worth a container revision on its
|
||||
own; together they are one:
|
||||
1. reserve palette index 0 as black, `I = 0` (23.4, this item);
|
||||
2. `--spans all` as the default (E2, and it is the loaded lever on the byte
|
||||
side);
|
||||
3. re-derive span selection jointly with `lam` (E3);
|
||||
4. **sector-align every record (58.3, new in session 26)** — +0.43% on the
|
||||
wire, zero clocks, and it is what lets P4a's DMA channel write straight
|
||||
into the ring with no window and no bounce copy. Until then the letterbox gets the palette's
|
||||
closest thing to black (index 255 on the gate container); `load.i` reports
|
||||
whichever index that is and needs no change when it becomes 0.
|
||||
|
||||
@@ -160,7 +173,8 @@ period from `htotal - 8`), so the tree's "1/55.46 s granularity" was 1/56.69 s
|
||||
throughout. No 68000 cycle figure moves — the CPU clock is unrelated to the
|
||||
screen — but anything paced by the raster does. 54.5.
|
||||
|
||||
**P4. Real transport. HALF DONE, session 25 — FINDINGS 57.**
|
||||
**P4. Real transport. P4b DONE, session 26 — FINDINGS 58. P4a OPEN, and it is
|
||||
now the ONLY thing between this tree and M2.**
|
||||
~~Drive the MB89352 instead of a host file.~~ `src/player/scsi.i` selects a SCSI
|
||||
target and issues READ(10) on the 68000, with no IOCS and no host in the
|
||||
transfer path: **4,096 B from LBA 0 and 2,048 B from LBA 1000, both byte-exact**
|
||||
@@ -184,12 +198,48 @@ cannot then distinguish a CPU-driven byte from a DMAC-driven one at that
|
||||
address**. "The DMAC held the bus" needs evidence that does not come from
|
||||
watching `$EA0015`.
|
||||
|
||||
**P4b. `scsi.i` behind `ring.i`'s `XF_*` mailbox**, in place of `stream.lua`'s
|
||||
modelled transport, gated on the same pixel-exact 120 frames. The seam already
|
||||
exists: `XF_ACK` stops being a word a host synthesises from emulated time and
|
||||
becomes one the 68000 bumps when a transfer lands.
|
||||
~~**P4b. `scsi.i` behind `ring.i`'s `XF_*` mailbox.**~~ **DONE, session 26 —
|
||||
FINDINGS 58.** `src/player/xfer.i` answers the mailbox with a real READ(10) per
|
||||
record: **120 records, 4,488,588 B, pixel-exact, out of the same 256 KB ring,
|
||||
with a real mid-stream seek in a second pass**. The tiling is the SAME 18 wraps
|
||||
and 14.7 KB mean hole that 49.4's host producer and 55.4's modelled transport
|
||||
produced — a third transport, same placement, which is the assertion that
|
||||
`ring.i` could not tell which side of the seam answered it. The change above the
|
||||
seam is two `bsr`s, and the one in `ring_seek`'s quiet-wait is not optional:
|
||||
with the transport inside the machine, that loop is the only thing that can
|
||||
retire an outstanding request.
|
||||
|
||||
`W` **did not move by one clock** and is still the largest open number here.
|
||||
**What it cost is the finding, and it re-prices P4a.** `tools/bench/
|
||||
xfer_cost.sh` subtracts the same 120 frames run twice and gets **87.28 clocks
|
||||
per delivered byte** — against the 68000's own cycle table for the loop, which
|
||||
says **87.15**. **0.2% apart**, so it is the instruction stream and not MAME's
|
||||
device model, and it is therefore the first number this rig has produced that
|
||||
survives leaving the emulator. At this container's 37,405 B mean record that is
|
||||
**391.8% of a 12 fps frame**, and the machine's own V-DISP clock agrees from the
|
||||
other end: **2.57 fps**.
|
||||
|
||||
W = 5 single address, bus HELD ............................ 22.4%
|
||||
W = 9 dual address, held .................................. 40.4%
|
||||
W = 12 single address, arbitrated .......................... 53.9%
|
||||
W = 19 dual address, arbitrated -- the IPL ROM's own (52.5) . 85.3%
|
||||
PIO 87 MEASURED, session 26 ................................ 391.8%
|
||||
|
||||
**So P4a is worth 4.6x the worst DMA configuration in this tree and 17.5x the
|
||||
best**, where before this session it was worth 9 against 19. `W` itself **did
|
||||
not move by one clock** and is still the largest open number — but what depends
|
||||
on it just got much larger.
|
||||
|
||||
**One more thing P4a inherits (58.3).** A record is not a sector: 117 of 120
|
||||
start part way into one. PIO absorbs that for free because the CPU is already
|
||||
touching every byte and simply does not store the ones outside the window — a
|
||||
property that **disappears the moment the DMAC takes over**, because a channel
|
||||
writes a contiguous run and cannot drop bytes. The three ways out price as
|
||||
+1.34% wire and no DMA (windowed PIO), +1.34% wire and **+5 clk/B of copy**
|
||||
(bounce buffer, which is exactly the cost `aligned` was chosen over `split` to
|
||||
avoid), or **+0.43% wire and zero clocks** (sector-aligned records in the
|
||||
container). The last one wins on both axes and is a **re-encode**; see the
|
||||
bundle under P2. **P4a should be attempted against a sector-aligned container,
|
||||
not against this one.**
|
||||
|
||||
*(original item, still the standing description of the `W` question:)*
|
||||
Drive the MB89352 instead of a host file. **Session 23
|
||||
@@ -328,12 +378,12 @@ Listed for completeness; past M3 these are scope, not risk.
|
||||
**Gated by E4.**
|
||||
- **E4. `H.build` k-means**, 51 s of a 55 s run, once per scene. The thing to
|
||||
attack before C1, and not anything in the per-frame path (27.6).
|
||||
- **E2. `--spans all` as default.** Still a recommendation, not a measurement
|
||||
- **E2. `--spans all` as default.** *(re-encode bundle item 2; see P2.)* Still a recommendation, not a measurement
|
||||
(43.6.1), and the only loaded lever on the encoder's byte side (44.3). **It
|
||||
spends every profitable byte, which raises `wire`, which shrinks `pipe - wire`,
|
||||
which lengthens the refill climb after every branch.** That interaction is not
|
||||
priced, and M3 is where it becomes measurable.
|
||||
- **E3. Re-derive span selection jointly with `lam`** (39.3).
|
||||
- **E3. Re-derive span selection jointly with `lam`** (39.3). *(bundle item 3.)*
|
||||
- **C2. Framing** — crop vs squash vs wide (FINDINGS 12). Needs an eyeball
|
||||
against arcade reference, not a measurement. Cheap; blocks only final encodes.
|
||||
- **C3. Disk image packaging**, ~1.09 GiB at the candidate rate.
|
||||
@@ -345,12 +395,12 @@ Listed for completeness; past M3 these are scope, not risk.
|
||||
|
||||
```
|
||||
B1 seek+rate ─┐
|
||||
B3 DTYP ──────┴─> P4 transport ─┐
|
||||
├─> M2 ─> M3 (COMPLETION TARGET) ─> M4
|
||||
P1 P2(half) P3 P5 P7 ───────────┘ ^
|
||||
│
|
||||
P6 (bus cost DONE, 52) ──────────────────┤
|
||||
G1 scene graph (DONE, 56) ───────────────┘
|
||||
B3 DTYP ──────┴─> P4a DMA HOLDS THE BUS ──┐ (P4b DONE, 58: the ring is
|
||||
│ filled off a real volume, and
|
||||
P1 P2(half) P3 P4b P5 P7 ─────────────────┤ PIO costs 87 clk/B)
|
||||
├─> M2 ─> M3 (TARGET) ─> M4
|
||||
P6 (bus cost DONE, 52) ───────────────────┤
|
||||
G1 scene graph (DONE, 56) ────────────────┘
|
||||
B2 blanking ─> (page 1; do not pre-build on it)
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user