# QuickFIX C++ CPU sampling inside original measured windows

This follows the completed original-threaded and checked-precision physical
campaigns. Every report flow remains diagnostic on both hosts. It changes
no SDK, canonical construction, extraction, full-session clock or report
policy, and grants no latency or comparison admission. The earlier
whole-process CPU profile remains unchanged with its original scope.

## Frozen inputs and method

The exact profiler is
`internal/bench/quickfix_cpp_measured_cpu_profile_20261018.py`, SHA-256
`e7f694134123f58755a9650519b5ba2169ad1021a80d99a85e7d8ff58eeb43fe`. It reads the qualified frozen standalone source
`b8d7eeb9fea7e4150a94b64ef0744036b97c8196`, original static SDK and dictionary,
and the existing threaded native binary
`6e2a13c0afe9443a8c2b43eb0dc28c35126ad7923a064ed7f9f37fb41f3218fe`.
No SDK or application driver is rebuilt. A tiny independent clock probe
is built with the recorded compiler; 10,000 runtime checks must bracket
`std::chrono::steady_clock::now()` between two `CLOCK_MONOTONIC` reads.

`perf record --clockid mono` explicitly selects that monotonic timestamp
epoch, sampling user cycles at 199 Hz with 4,096-byte DWARF call stacks.
The NOS and MD localhost pairs retain the same ten-cycle prefix, 1,000
warmup / 20,000 measured cycles and 10,000/s request. Every original role
admin observation must declare exactly one complete measured window.
`perf report --time START,END` selects that role's original nanosecond
start/end, converted to decimal seconds using integer arithmetic. Neither
startup nor warmup is included in the selected CPU report.

The client window spans its measured run; the server window spans the first
measured callback through the final reply, as declared by its existing
observer. Profiles include every sampled thread in that process during
that role-local window. They are CPU shares, not fractions of RTT.
Inclusive shares overlap, unresolved symbols remain visible and the bounded
stack depth can limit attribution. They establish no report-grade speedup.

The exact original command, role admin-file hash and window boundaries are
recorded. Full perf data and reports stay on the host; collected text
collapses whitespace and caps each line at 500 characters while retaining
the original full-report hash and size. Source/SDK/product bytes and modes
must remain identical before and after. The unchanged independent pair
checker must pass full wire/owner/raw/admin and prefix checks.

## Host scheduling

The job queues on SCAN through an outer `host-cpu-slot wait --pool shared`
normal-priority lease, explicitly pinned to CPUs 0–9. Host slot/process/RAM/
disk checks run before work. The working output uses
`~/build/codex-fullbench/libhft/quickfix-cpp-measured-cpu-profile-20261018-v1`.
It is a localhost CPU diagnostic and has no physical, timing or comparison
grade. The actual queued run and bounded evidence are pending at this
checkpoint; no percentages are inferred from the earlier whole-process run.

## Actual measured-window profile completes

The normal-priority shared lease is granted after the existing Java build.
Both NOS and MD localhost pairs pass every independent functional check
and all four process exits are zero. Each pair retains 20,000 measured
cycles after its ten-cycle prefix and 1,000-cycle warmup. Both original
role-local admin windows are complete and match the selected `--time`
arguments exactly. All eight self/inclusive reports contain CPU samples
inside those windows. No full-process percentage is substituted.

The runtime clock probe passes all **10,000** bracket checks; its widest
bracket is 1,007 ns. Both native processes explicitly record with
`--clockid mono`. Perf version is `5.14.0-687.58.1.el9_8.x86_64`, with
the recorded 199 Hz user-cycle event and 4,096-byte DWARF stacks. The
actual SDK, source, native binary and dictionary remain unchanged in
bytes and modes. These are shared-CPU localhost profiles and supply no
physical, timing or matched-comparison admission.

Some selected measured-window CPU shares are:

| Flow / process | Symbol or path | Share type | Sampled CPU share |
|---|---|---|---:|
| MD server | `qfcanonical::snapshot` | inclusive | 45.01% |
| MD server | SDK `DoubleConvertor::fast_dtoa` | inclusive | 20.64% |
| MD server | SDK `DoubleToStringConverter::ToPrecision` | inclusive | 18.89% |
| MD client | SDK wire-message constructor/parsing path | inclusive | 26.11% |
| MD client | `qfcanonical::read_snapshot` | inclusive | 15.23% |
| NOS server | SDK `DataDictionary::iterate` | self | 7.26% |
| NOS client | shared `BenchRunner::RunLoop` | self | 7.47% |

Inclusive entries overlap and must not be added. In particular, the snapshot
path includes decimal-conversion work; these percentages are not separate
fractions of end-to-end latency. The SDK constructor above takes the
received string and data dictionary, so it is the incoming wire parsing
path, not the startup dictionary load or only the outgoing request builder.
Unknown addresses and truncated long symbols remain explicit in the saved
text. The sample and stack limits do not support a complete per-function
cost model or a report-grade performance claim.

Twenty-five bounded metadata/derived-text payloads match their original
lengths and SHA-256 values. Their window files reproduce each exact original
admin record and hash, integer timestamp conversion and report command.
Original perf data, application captures, primary/delay series and full
reports remain on SCAN. No such raw files are downloaded or added to Git.
Qualification receipt SHA-256:
`7de5144a37fad17871a12d6e84df71ca48f62beca9179280a362984d69d6bdef`.
Clock-probe source SHA-256:
`7fcecf6542dbe770a0530590e0ce5bf787dbed6f3fbdfdfa84bdbac5d4a6fdcb`.
Clock-probe binary SHA-256:
`eaeb7ec64012b8d1948e1cc7d5c031ca6bd1883ab2770fe8534a6d97754bfb50`.

The actual profile stays under its stated SCAN build root. Local bounded
review metadata stays under
`~/build/codex-fullbench/libhft/qfcpp-precision-review-20261018-v1/scan/measured-cpu-profile`.
Both separately frozen physical campaigns retain their original S5
diagnostic outcomes and zero promoted cells. The original 10,000/s contract
and pending lower-rate policy question are unchanged. The full plan remains
incomplete; this CPU investigation identifies work to assess before any
further source/configuration candidate, without repeating failed timing
matrices or weakening SDK validation.
