Harden the ratchet, tests and CI ahead of the monorepo migration (step P) - #18
Merged
Merged
Conversation
- icount.py (ported in step with SampleRateTap's): --exact, --json-out and --compare-json for same-job A/B measurement, a failure when a recorded workload has no binary, a fatal error on a missing baselines file, and the workload checksum printed and recorded. Hexagon workloads run from one fixed path with a fixed argv[0] and an empty environment, because qemu-hexagon copies those onto the guest stack and static musl's startup walks them; qemu-hexagon is resolved to an absolute path first. Hexagon baselines are re-recorded separately. - Tests carry a "ratio." ctest prefix and a ratio label (the bare-metal entry too), so names stay unique once they share a tree with SampleRateTap's. - New OutputHash suite: FNV-1a hashes of the converter's output for both directions, every format and every profile, printed for same-job comparison and never pinned. About 8 s on Cortex-M33. - The cross-validation lines now print their tolerance, so a loosened limit is visible in the output and not only in the source. - CI: contents: read permissions; cancellation spares main and the migration PR; every action SHA-pinned (checkout v6, cache v5, as in SampleRateTap); ubuntu-24.04 pinned for QEMU and ratchet jobs, with the image OS in the plugin-qemu cache key and image/toolchain versions logged; --no-tests=error on every ctest; QEMU legs keep and upload full test logs. Step P.2 of the monorepo migration plan (SampleRateTap docs/MONOREPO_PLAN.md). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015VR1VC4SDGxHZQQsQvPBaA
The previous commit runs Hexagon workloads from a fixed path with a fixed argv[0] and an empty environment. The first isolated CI run (PR #18) measured every scenario 3,724 to 3,809 instructions lower (-0.0004% to -0.0136%): the path and environment strings static musl's startup used to walk. Inside the gate, but re-recorded so exact comparisons start from the new harness; PLAN.md section 7 ledger entry. M33/M55 are unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015VR1VC4SDGxHZQQsQvPBaA
- requirements.in / requirements.lock at the repository root: the notebook environment pinned with hashes (numpy 2.4.6, scipy 1.17.1, matplotlib 3.11.2, jupyter/nbconvert; samplerate and soxr for SampleRateTap's comparison notebook, since the file is identical in both repositories). It replaces notebooks/requirements.txt, which named packages without versions. - ratiotap_py rebuilds build_capi/ incrementally on every import instead of only when the library is missing, so a library left over from an older checkout can no longer be measured silently, and the build is quiet (its log used to land in ratio_demo's committed output; it now prints only on failure). - notebooks/figure_digest.py wraps plt.show() to print a digest of each figure's plotted data, quantized to 9 significant digits of each array's peak, so a changed curve shows up as changed text; stable across re-executions. - All three notebooks re-executed in the pinned environment: every committed number reproduces exactly; the only output changes are the added digest lines and the removed build log. Step P.3 of the monorepo migration plan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015VR1VC4SDGxHZQQsQvPBaA
tap
marked this pull request as ready for review
September 27, 2026 20:39
tap
pushed a commit
that referenced
this pull request
Sep 27, 2026
The previous commit runs Hexagon workloads from a fixed path with a fixed argv[0] and an empty environment. The first isolated CI run (PR #18) measured every scenario 3,724 to 3,809 instructions lower (-0.0004% to -0.0136%): the path and environment strings static musl's startup used to walk. Inside the gate, but re-recorded so exact comparisons start from the new harness; PLAN.md section 7 ledger entry. M33/M55 are unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015VR1VC4SDGxHZQQsQvPBaA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
This is RatioTap's half of step P, the pre-work before the monorepo migration. The plan lives in SampleRateTap at
docs/MONOREPO_PLAN.mdonclaude/sample-rate-expansion-strategies-ezqzu6, and tap/SampleRateTap#48 is the companion PR.P.2: harness and CI (df8cd61, 8550e07)
scripts/icount.pyis changed in step with SampleRateTap's copy; the two differ only in their constants.--exact,--json-outand--compare-jsonoptions.argv[0], empty environment.ratio.ctest prefix and aratiolabel, including the bare-metal entry.OutputHashsuite: hashes are printed for comparison, never pinned.contents: readpermissions.mainand on the migration PR are never cancelled.ubuntu-24.04, with the image OS in the cache key and the versions logged.--no-tests=erroreverywhere.P.3: notebooks (9c92818)
requirements.inandrequirements.lockat the repository root pin the notebook environment with hashes. The file is identical to SampleRateTap's, and it replaces the unversionednotebooks/requirements.txt.ratiotap_pynow rebuildsbuild_capi/incrementally on every import, and quietly; its CMake log used to land inratio_demo's committed output.notebooks/figure_digest.pyprints a data digest for each figure.Why
The migration gates key tests by unique names. They compare exact icount, output hashes, full on-target logs and notebook outputs, all of which must exist before the step-0 snapshot.
Verification
-Werror, all namedratio.*and labelledratio.-Werror. Hashes are identical to GCC's and stable across runs.--exact, and the emulated suite passes in 33 s.pip install --require-hashes -r requirements.lockon Python 3.11.15. The digests are identical across two re-executions.Notes for the reviewer
ratio.prefix).submodules/sampleratetapis re-pinned to SampleRateTap's post-step-Pmain(P.4).🤖 Generated with Claude Code
https://claude.ai/code/session_015VR1VC4SDGxHZQQsQvPBaA