# Stream helper review and Java indexed misses, 2026-10-19

Session `codex-review-streams-1019`, thread `01a0fcb1-4c4d-7380-bb51-0d6ed4a2b4d6`,
on BEELINK2. Three parallel reviewers covered C++, .NET and Rust frame/field helpers;
the root review covered Java. Heavy work is serialized with the shared host lease,
resource checks and at most 16 workers, with all outputs outside the worktree.

## Corrections

`tools/check-telemetry-snapshot-contract` still selected 16 C++ source/test paths
under the removed `engine/cpp` root. The Java and .NET path migrations had landed;
the Java owner explicitly left the C++ paths outstanding. Correcting the 16 root
expressions to `oss/cpp` changes no contract assertions. The baseline fails before
checking its first C++ source; the corrected checker passes the 25 canonical
snapshot fields, 28 FIXP fields, six counters and eight reconnect fields. It
covers each implementation named by the corresponding fixture. The fix was
published separately as `02c351edd9046b316927ab5aa9e2b810c96beab1`.

Java `MessageView.find` populated a complete generation-stamped index for tags
below 512, but still scanned all parsed fields when that index proved a tag absent.
This affects repeated reads of optional fields through generic and typed views.
It now returns absence directly for that range, matching C++ `Message::FindField`.
The vendor-tag fallback and duplicate-first-value behavior remain unchanged.
Every exposed parsed field is indexed before the count advances, including
prefixes of rejected frames. Clear/reuse paths and generation rollover preserve
this invariant; an independent reviewer checked them.

Seven public-API cases cover missing accessor defaults, present/absent/present
reuse, duplicates across the 511/512 boundary and high vendor tags, null/range/empty
wrap clearing, and the existing visible-prefix behavior after a malformed tail.

## Qualification

At `a060351e6494ff1dfcd9e321efac74ea41e047d3`, the seven selected Java test
classes pass 53/53 with zero failures, errors or skips. These are pure Java helper
tests; no JNI runtime coverage is claimed. The baseline overlay replaces only
MessageView with its source from `fdd7db39b8cbb468cede1e6f210efaf04dce7f07`,
compiled with the same Java 8 target as Maven. It runs the same compiled tests and
dependencies, also 53/53 with zero ignored tests or failed assumptions. The seven
new lookup cases pass on both versions because this change preserves behavior.
All `javap -p -c` output outside `find(int)` is identical. The public-path scrub
and telemetry contract checker also pass.

The first local lookup probe uses OpenJDK 21.0.12.1, CPU 0, 128 MiB heap,
`-Xbatch -XX:-TieredCompilation`, five warmup rounds and five measured rounds of
500,000 calls per scenario. Four fresh JVMs use baseline/fixed/fixed/baseline order,
but each JVM runs all twelve scenarios sequentially. Every sample verifies its
exact hit count. Median nanoseconds per lookup below are amortized loop costs,
not individual-event latency or engine measurements:

| Fields | Queries | Baseline ns | Fixed ns |
| --- | --- | ---: | ---: |
| 16 | indexed-miss | 5.685 | 0.647 |
| 16 | indexed-hit | 1.135 | 1.141 |
| 16 | mixed | 5.156 | 0.949 |
| 16 | vendor-miss | 4.877 | 5.639 |
| 128 | indexed-miss | 27.091 | 1.032 |
| 128 | indexed-hit | 1.050 | 1.468 |
| 128 | mixed | 16.243 | 1.155 |
| 128 | vendor-miss | 23.247 | 21.887 |
| 384 | indexed-miss | 67.980 | 0.904 |
| 384 | indexed-hit | 1.173 | 1.456 |
| 384 | mixed | 47.999 | 1.028 |
| 384 | vendor-miss | 66.566 | 67.314 |

Indexed misses and mixed queries improve substantially in this local probe.
The sequential-scenario probe also records slower hit-only controls at 128/384
fields, so it does not establish control neutrality. The retained reports include
all these results; none are discarded. This prompted a fresh-JVM-per-scenario
follow-up with 16,000,000 calls per round, keeping the same ABBA ordering and flags.

The isolated follow-up uses a fresh JVM for each scenario and edition, five
warmup and five measured rounds of 16,000,000 lookups, and two JVMs per edition
in ABBA order. All 80 samples have the exact expected hit count. Per-JVM median
nanoseconds per lookup are:

| Fields | Query | Baseline JVMs | Fixed JVMs |
| --- | --- | ---: | ---: |
| 128 | indexed-hit | 0.784, 0.932 | 0.727, 0.809 |
| 384 | indexed-hit | 0.727, 0.726 | 0.891, 0.856 |
| 16 | vendor-miss | 3.467, 3.578 | 3.976, 3.602 |
| 128 | indexed-miss | 19.185, 19.145 | 0.509, 0.508 |

The 128-field hit slowdown from the sequential-scenario probe does not repeat in
these isolated JVMs. The 384-field hit control remains about 0.15 ns slower;
that tradeoff is retained rather than dismissed as noise. Vendor-miss timings
overlap. The 128-field indexed-miss improvement remains clear, at about 19.2 ns
to 0.51 ns. The optimization is accepted for removing the proven linear miss
path, with its measured hit-only tradeoff documented. These few forks are not
a statistical guarantee for other machines, JVM profiles or query mixtures.
The initial helper is retained as `LookupProbe-initial.java`; the follow-up
helper adds only scenario filters around the same lookup loop.


No end-to-end engine latency or universal workload improvement is claimed.


## Review scope and remaining work

No additional supported-input correctness defect was confirmed in the reviewed
C++ FIX/FIXP stream and cursor helpers, .NET frame/field helpers, or Rust wire,
cursor, typed-view and projection paths. Deliberately pinned timestamp/checksum
behavior was not reclassified as a bug. This bounded source review is not a
complete engine qualification.

The earlier open .NET mmap refusal regression remains in the frozen native seam:
`oss/dotnet/src/native/hftnet.cpp` validates an unavailable mmap profile before
returning its intended Unsupported status, so the direct ABI returns InvalidArg.
The existing REQUEST ONLY entry and candidate patch handoff remain in place.
No native files were edited or native runtime verification claimed in this batch.

Rust typed getters reusing an already-computed FieldIndex remain a possible future
performance investigation; the API/lifetime and benchmark work are not done here.

Raw logs, baseline source overlay, bytecode, exact commands, hashes and any local
probe samples are archived outside Git under
`~/archive/libhft/reviews/2026-10-19-codex-review-streams-1019`.

## Publication equivalence

After the publication rebase, the entire `oss/java` root and telemetry checker
are byte-identical to the qualified source. Exact source pins and the incoming
path list are retained in `publication-equivalence.json`. The standard split
and outgoing author/DCO checks run at the push boundary; their actual outputs
are included in the archive.
