# SCAN local GCC 14 tuning — 2026-09-08

The full local tune completed successfully. All 12 probe verdicts passed the
current robust tuner gates; `any_inconclusive=false`, `recommend_rerun=false`,
and all three run-quality warning lists are empty. This is a candidate build
prescription, not an end-to-end latency improvement claim.

## Evidence and scope

The [new profile directory](../../internal/engine/cpp/tools/libhft-tune/profiles/scan-broadwell-gcc14-20260908/)
contains the generated header, Makefile fragment, result JSON, report and raw
samples. The older `scan-broadwell-lowlat` GCC 11 profile is unchanged.

The run used the Intel Xeon E5-2698 v4 on scan, GCC 14.2.1 from
`/opt/rh/gcc-toolset-14/root/usr/bin/g++`, `-march=broadwell`, and isolated core 19.
AVX2 is available; AVX-512 and VNNI are not. Up to 24 adaptive samples were
requested per variant. Turbo, governor, isolation and machine-load preflights
passed. Two external one-second checks found core 19 idle before launch; the
tuner's own `probe_core_idle` remains null because the core was explicitly chosen.

No load benchmark ran during tuning. Compiler/helper work and light repository
maintenance used housekeeping cores 0–9. C++/tuner inputs remained unchanged from
`0c60929b` until completion; source changes were not merged into that checkout
during the run. Git synchronization used a separate checkout. This is not a
claim that no housekeeping activity or system disturbance occurred.

External evidence is under
`/home/yann/libhft-bench-runs/gcc14-local-tune-20260908-7U4n1s`.

```sh
taskset -c 0-9 python3 -u -B tools/run-tune \
  --cxx /opt/rh/gcc-toolset-14/root/usr/bin/g++ --core 19 --reps 24 \
  --outdir /home/yann/libhft-bench-runs/gcc14-local-tune-20260908-7U4n1s/profile \
  --emit-raw /home/yann/libhft-bench-runs/gcc14-local-tune-20260908-7U4n1s/raw
```

## Selected kernels

| Kernel | Pick |
| --- | --- |
| Tag parsing | unrolled |
| Checksum | vpaddb_masktail |
| Byte scan | SSE2 |
| Tiny / medium copy | descend / headtail |
| Timestamp | current |
| Integer formatting | SSE2 |
| Integer parsing | mask8_delim |
| Decimal formatting / parsing | current / scalar |
| Field split | composed |
| Structural parser | disabled (`seq`) |

Against the tracked GCC 11 SCAN profile, common primitive picks differ only in
decimal formatting: `clean_arms` becomes `current`. Against the untuned source
fallbacks, the tune also selects unrolled tag parsing, SSE2 byte scanning, SSE2
integer formatting and `mask8_delim` integer parsing. These are different
comparisons; the stopped GCC 14 load baseline used no tuning profile.

Independent replay reconciled all 56 variant medians/CVs, 44 auxiliary values,
and all 25 prescribed header/Makefile entries. The result JSON hash is
`11d76874cc5a8cf1fbb55741db654e35f18d48ed9ab45ece3a57d13214eed6b3`;
header hash `c9ec6b8dce74de0080bc8844c794ee021d34ac7ebe3f96bd381a97ab714ad469`;
Makefile fragment hash `84b752a6047481f4801e1c786543f15bbef8ea8dabb023784ae5cbd250f61516`.

## Correctness validation completed

All tests were compiled with GCC 14, Broadwell flags and `-include` of this exact
profile. They ran on housekeeping cores, without staging production artifacts or
running a network benchmark.

- Package `selftest_kernels.cpp`: PASS for the selected combination, including
  62,314 field-split corpus cases and all 12 primitive test functions.
- Engine checksum, byte scan, tiny/medium copy, timestamp, integer formatting,
  integer parsing, decimal formatting and decimal parsing tests: PASS.
- Decimal formatting includes the complete 10^7 factor-7 regression domain;
  decimal parsing includes 107 shared vectors and a guard-page overread check.

The checksum test initially mislabeled the selected `vpaddb_masktail` kernel as
`scalar` in its final message. Preprocessor inspection verified the correct
selection; the missing diagnostic branch was fixed and the test rerun successfully.
This changed the test label, not the checksum implementation.

Validation binaries are retained under
`/home/yann/libhft-bench-runs/gcc14-selected-profile-validation-20260908.sNnk8k`.

Thirteen existing whole-FIX correctness suites also pass with the exact profile:
43 conformance groups, typed builders/views, frame compaction, zero-copy windows,
274 malformed-frame cases under four policies, structural-parser behavior, field
and cursor access, compact events, generated validators, validation flags and the
zero-allocation hot-path tripwire. A separate macro probe confirms every selected
primitive. All 68 non-system input dependency hashes remained unchanged; these
tests do not depend on the transport headers being repaired concurrently.

Those commands and logs are retained under
`/home/yann/libhft-bench-runs/gcc14-whole-fix-profile-20260908-WUssDx`.
These are optimized, assertion-enabled, non-LTO correctness builds, not production
ABI or performance tests. GCC 14 emitted unsuppressed typed-view boundary warnings
in the explicit over-64-entry test, which passed; this is not a sanitizer proof
or a warning-baseline comparison.

## Production build and installation read-back

Runtime commit `9443f6a3` was rebuilt through the normal C++, Java and .NET build
paths with this exact profile and compiler. All three C++ transports, JNI with
both native stacks, .NET Native with both stacks, Java jars/dependencies and the
managed programs built successfully on cores 0–9. Sources stayed frozen.

The approved installer staged all required artifacts, including the separately
installed `libhftnet` library. All 52 enumerated local/stage/installed pairs match.
Cold JNI ABI loading and .NET Native profile probes pass for every kernel,
TCPDirect and SocketXtreme filename: `tuned_build=1`, selected checksum, byte scan
and tiny/medium copy. These probes expose four primitives, not the complete tuner
prescription; retain the build manifests for the remaining selections.

One pre-existing extra Java adapter jar remains on the wildcard classpath:
`libhft-java-0.1.0-SNAPSHOT-quickfixj-adapter.jar`, SHA-256
`9f12f512ac427673600f26ffe759062141e5d000d1e826a9f16fbcc16e58a091`.
Inspection found no overlapping classes, autoload hooks or fresh-runtime references
to its package. The two benchmark providers are selected explicitly, not by service
discovery. No activation path was identified, but this is not an exact-tree match;
the merge-style installer does not prune old files. It was not silently deleted.

Full commands, logs, hashes, cold probes and that qualification are retained under
`/home/yann/libhft-bench-runs/gcc14-tuned-build-20260908-PaIKhr`.
Fresh live checks and load comparisons are still required; no end-to-end latency
improvement follows from build or primitive-test success.

The later ownership repairs and C++/Java cold phase evidence were rebuilt from
`368b1374` using the same profile. C++, Java/JNI and .NET builds passed with frozen
inputs; staging completed at 2026-09-08 16:12:11 UTC. Again all 52 enumerated pairs
match and all six named native-library routes pass the cold profile probe, with
the same unchanged extra adapter-jar qualification. Commands and fresh manifests:
`/home/yann/libhft-bench-runs/gcc14-tuned-owner-build-20260908-qj2IRG`.
This supersedes the earlier installed build, not its preserved measurements.

The subsequent Java-only cold fused-owner marker and placement-audit update
(`e72c35d8`) passed 18 Java startup and 30 placement tests. The normal Java/JNI
build completed with frozen inputs and the same GCC 14 profile; staging completed
at 2026-09-08 17:03:44 UTC. All 52 enumerated pairs match and all three JNI routes
pass cold profile probes. The new engine jar SHA-256 is
`a3768e4396231c8bfba42c61c6494ab90821317342aab3895a6dc5a34319fee1`;
JNI and its three aliases are
`fb4ee6d9439a2c74f042b928091d166a5100aa1ffe02a4beefa4c2835c1809a7`.
C++ and .NET artifacts remain the preceding verified build. Evidence is retained
under `/home/yann/libhft-bench-runs/gcc14-tuned-owner-marker-build-20260908-GzmrPw`;
the unchanged extra adapter qualification still applies.

## Reporting limitations

The recorded CV is the current tuner's robust-MAD statistic combined with the
last internal CV. Passing does not mean every repetition had low ordinary
variance: for example, unrolled tag parsing contains a 7.7008 sample alongside
approximately 7.092 samples. Retained raw evidence is not discarded.

The report calls its cycle measure frequency-invariant, but the harness measures
RDTSCP ticks, not variable-frequency core cycles. Do not infer immunity to turbo,
frequency changes or other disturbances. The report's expected warning that
AVX-512 is not measurable on this CPU is distinct from its empty run-quality
warning lists. Its human and embedded measurement sections omit decimal parsing;
the authoritative result JSON, raw samples and header retain the scalar pick.
The TLS cipher entry is an unmeasured default and irrelevant to these non-TLS cells.

## Reproducing the explicit build opt-in

All native consumers must use the same absolute profile directory and compiler:

```sh
export LIBHFT_TUNED_DIR="$PWD/internal/engine/cpp/tools/libhft-tune/profiles/scan-broadwell-gcc14-20260908"
export LIBHFT_TUNED_USE_CXX=1
```

This is a build input, not an installation step. Rebuild and stage C++, JNI and
.NET Native consistently, verify local/installed hashes and cold profile probes,
then measure a fresh labelled sitting. Pure Java and .NET Pure do not consume
this C++ kernel profile. Do not replace existing latency data with primitive timings.
