# HPT USB CSV buffered-publication acceptance

Status: complete
Type: evidence
Updated: 2026-07-26
Next Action: retained as the accepted 8 KiB rollback baseline; see the 32 KiB successor evidence

Parent: work/wp/completed/wp-optimize-hpt-usb-csv-publication-throughput.md
Successor: work/evidence/hpt-usb-csv-buffer-window-tuning-20260726.md
Canonical Truth: docs/sd-card-operation-and-recovery.md

## Result

The bounded 8 KiB CSV writer was built, programmed, and qualified on
Controller B first and Controller A second. Both controls published a real
retained-range export through the complete temporary-file, count, trailer,
close, first flush, rename, and final-flush sequence.

| Metric | Controller A | Controller B |
| --- | ---: | ---: |
| Records scanned / selected | `1,814 / 1,813` | `1,766 / 1,761` |
| Healthy / degraded | `1,813 / 0` | `1,680 / 81` |
| Snapshot / requested gaps | `0 / 0` | `0 / 0` |
| HPT staging | `2.30 s` | `2.19 s` |
| USB publication | `0.64 s` | `2.38 s` |
| Total end to end | `2.97 s` | `4.58 s` |
| Row construction | `0.22 s` | `0.24 s` |
| File writes | `0.36 s` | `1.05 s` |
| Close / both flushes / rename | `0.01 / 0.02 / 0.03 s` | `0.01 / 0.55 / 0.04 s` |
| File write calls | `12` | `11` |
| Bytes requested | `91,697` | `89,081` |
| Largest write / buffer | `8,178 / 8,192 B` | `8,184 / 8,192 B` |
| Complete / published | `1 / 1` | `1 / 1` |
| HPT / USB status | `0 / 0` | `0 / 0` |

Compared by per-record rate with the prior unbuffered samples, USB publication
improved `34.15x` on A and `13.71x` on B. End-to-end export improved `8.15x`
and `7.62x`. The measured B result remains slower because its stick spends
`0.55 s` in durable media flushes and `1.05 s` in FileX writes, but the old
per-row write penalty is removed.

## Long-range projections

The following projections scale each control's measured per-record time to
one-minute logging. They are not direct 30- or 90-day exports.

| Control | Range | Records | HPT staging | USB publication | Total |
| --- | ---: | ---: | ---: | ---: | ---: |
| A | 30 days | `43,200` | `54.8 s` | `15.2 s` | `1.17 min` |
| A | 90 days | `129,600` | `2.74 min` | `0.76 min` | `3.50 min` |
| B | 30 days | `43,200` | `53.7 s` | `58.4 s` | `1.87 min` |
| B | 90 days | `129,600` | `2.69 min` | `2.92 min` | `5.61 min` |

The conservative 90-day result is therefore approximately `5.6 min`, reduced
from the prior B projection of `42.81 min`. Optional FAT preallocation is not
justified by the measured result because it would add allocation and
fault-tolerant FAT transaction complexity after the primary bottleneck has
already been removed.

## Candidate and software gates

- Debug S-record SHA-256:
  `7F3658A388D24A10BF7EA93ED061FF41CECF6273DDC2339DD143D48BD9212B84`
- Debug ELF SHA-256:
  `8F6DB1BB408864AD3150563F120412B5AAA5BA2ADBA73FD98AEC99DE6FE442CB`
- Debug map SHA-256:
  `C47B035F10CC4C77BC0BFA14DCDF1537FC2171BA59657D7952515679D94068AD`
- Production-name package: `7520553_SMI_FW_00_05_00`
- HPT customer-export invariants: `25/25 PASS`
- Repository check suites: `21/21 PASS`
- Python model suites: `8/8 PASS`; `py_compile` PASS
- Managed isolated clean Debug build and package: PASS
- `gHptExportStatus` layout: `0xF8`, confirmed from the successor ELF

## Identity and preservation

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

Baseline and post-export captures show zero system errors, dropped logs,
mirror mismatches, or lost records. A remains aligned with lane starts
`1 / 1 / 1`, active starts `1024 / 1024 / 1024`, and no retirements. B was
not formatted or normalized: it retains oldest starts `86 / 86 / 1`, active
starts `1109 / 1109 / 1024`, and retirements `2 / 1 / 0`.

No SD format, initialization, card replacement, powered removal, or
configuration mutation occurred.

## Operator-visible end state

Both Graph screens were reopened with RAM-only review commands and are active,
following newest, and rendered at the current publication sequence. At final
capture the viewport lag was `0 s`; the newest record was `22 s` behind RTC on
A and `46 s` behind RTC on B.

Boot cache timing on the exact image was:

- A: `2.10 s` traversal, `2.95 s` complete elapsed;
- B: `2.02 s` traversal, `2.88 s` complete elapsed.

## Raw captures

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

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