# HPT USB-publication timing and read-performance disposition

Status: complete
Type: evidence
Updated: 2026-07-26
Next Action: none; treat additional USB CSV throughput work as a separate product optimization if long-range export time becomes a requirement

Parent: work/wp/completed/wp-optimize-hpt-triple-mirror-read-performance.md
Canonical Truth: docs/sd-card-operation-and-recovery.md

## Result

The successor image passed the software/build gate, was programmed on
Controller B first and then Controller A, published one real retained-range
CSV on each mounted USB stick, and left both controls running at the Graph
screen. Target timing now spans:

1. HPT snapshot traversal and SDRAM staging;
2. USB publication from before the first FileX operation through CSV close,
   first media flush, temporary-file rename, and final media flush; and
3. total export time from the start of HPT traversal through final USB
   publication.

| Metric | Controller A | Controller B |
| --- | ---: | ---: |
| Records scanned / selected | `1,782 / 1,762` | `1,734 / 1,711` |
| Healthy / degraded | `1,762 / 0` | `1,630 / 81` |
| Snapshot / requested-range gaps | `0 / 0` | `0 / 0` |
| Bulk fallbacks | `0` | `0` |
| HPT staging | `2.28 s` | `2.17 s` |
| USB publication | `21.24 s` | `31.71 s` |
| HPT-to-USB queue wait | `0.01 s` | `0.03 s` |
| Total end to end | `23.53 s` | `33.91 s` |
| Complete / published | `1 / 1` | `1 / 1` |
| HPT / USB status | `0 / 0` | `0 / 0` |

The A/B HPT rates are close: approximately `773` and `789` selected
records/second. The material A/B difference is in FileX/USB publication:
approximately `83.0` versus `54.0` selected records/second. The current
three-mirror read path is therefore no longer the dominant end-to-end export
cost on either control.

The controller reported successful final rename and flush. The CSV contents
and hashes have not yet been host-read because the sticks remained mounted in
the controls for this test.

## Linear long-range projections

The projections below scale the observed per-selected-record times to normal
one-minute logging. They are not direct 30- or 90-day target captures and USB
media, fragmentation, row length, and FileX behavior can change the result.

| Control | Range | Records | HPT staging | USB publication | Total |
| --- | ---: | ---: | ---: | ---: | ---: |
| A | 30 days | `43,200` | `55.9 s` | `8.68 min` | `9.61 min` |
| A | 90 days | `129,600` | `2.80 min` | `26.04 min` | `28.84 min` |
| B | 30 days | `43,200` | `54.8 s` | `13.34 min` | `14.27 min` |
| B | 90 days | `129,600` | `2.74 min` | `40.03 min` | `42.81 min` |

These results replace estimates that included only HPT staging. Any future
export-speed effort should measure and optimize the USB CSV/FileX path; further
three-mirror read tuning would have limited effect on total time.

## Four-times stretch-goal disposition

The original normalized iterator stretch target was `4x`. The measured gain
remains `2.39x` on A and `2.36x` on B, so the `4x` target was not met and is
not claimed.

The read-performance implementation is accepted despite that stretch miss:

- SD read commands fell by more than `31x`;
- the physical sector-transfer and three-copy validation time now dominates,
  and increasing the lane window from bulk-8 to bulk-16 showed diminishing
  elapsed-time return;
- the normal 30-day cache/staging projections meet the practical sub-`60 s`
  targets on both controls;
- the split-lane B card passed without format, initialization, card
  replacement, weakened mirror validation, range gaps, or scalar fallback; and
- end-to-end measurement shows USB publication, not HPT traversal, is the
  remaining performance bottleneck.

The `4x` value is therefore closed as an unmet stretch goal, not converted
into a claim of success and not retained as a release blocker. No USB
publication speed threshold was defined for this workpackage; the measured
long-range projections are accepted as characterized behavior, not as proof
that long-range USB export is fast.

## Candidate and build

- Debug S-record SHA-256:
  `A7055AC3F4314EEF440ADA77B76B107C387BDBC68095AD6E1EEBC15D04074FA4`
- Debug ELF SHA-256:
  `D32C82D4D55AD08091B82B20ACEFC275C54E4A6FC59CEDDC2164B5A09936A554`
- Debug map SHA-256:
  `D1302C9B33A0EE0E882D72F018C02E3803C3994284B44F793AF008BC43A58280`
- Production-name package: `7520553_SMI_FW_00_05_00`
- HPT customer-export invariants: `22/22 PASS`
- All repository `script/check-*.ps1` suites: `21/21 PASS`
- Python model scripts: `8/8 PASS`; `py_compile` PASS
- Managed clean Debug build and production-name package: PASS

## Target identity and preservation

| Control | Assembly / J-Link | Protocol / CID / representative read | Raw CID |
| --- | --- | --- | --- |
| A | `1751136 / 69664082` | `6 / 1 / 0` | `035344535330384780976F0084018559` |
| B | `1751219 / 69660123` | `6 / 1 / 0` | `035344535330384780976F0085018507` |

Both are SanDisk/WD MID `0x03`, OEM `SD`, product `SS08G`, revision `8.0`,
manufactured `2024-05`. A reports serial `2540634244`; B reports
`2540634245`. Post-export captures show zero system errors, dropped logs,
mirror mismatches, or lost records. A remains aligned. B retains oldest lane
starts `86 / 86 / 1`, active starts `1109 / 1109 / 1024`, and retired
segments `2 / 1 / 0`.

No SD format, initialization, card replacement, powered removal, or
configuration mutation occurred. A discarded harness setup attempt on B used
J-Link `loadbin`, which implicitly reset the controller before any qualifying
export was released. The harness was corrected to byte-wise RAM writes, B's
same CID and ready cache were recaptured after that reboot, and only the later
export is used above.

## Operator-visible end state

The same exact image is running on both controls. RAM-only Graph commands were
consumed without media or configuration mutation. Final captures report:

- A: Graph active, following newest, rendered sequence current, viewport lag
  `0 s`, newest record `53 s` behind RTC at capture;
- B: Graph active, following newest, rendered sequence current, viewport lag
  `0 s`, newest record `9 s` behind RTC at capture.

## Raw target captures

- A:
  `work/evidence/hpt-log-store-circular-mirror/controller-a/usb-publication-timing-20260726/`
- B:
  `work/evidence/hpt-log-store-circular-mirror/controller-b/usb-publication-timing-20260726/`

The compact JSON files are the review surface. Binary J-Link captures remain
supporting evidence and should not be reviewed through per-file diffs.
