Skip to content

Promote Hexagon instruction-count ratchet leg to gating - #5

Merged
tap merged 4 commits into
mainfrom
claude/hexagon-icount
Jun 10, 2026
Merged

tap merged 4 commits into
mainfrom
claude/hexagon-icount

Conversation

@tap

@tap tap commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Makes Hexagon instruction-count gating real, closing the gap left experimental in #4.

The blocker and the fix

Neither Debian's qemu-user nor the CodeLinaro toolchain's bundled qemu-hexagon is built with TCG plugin support (confirmed: #4's probe skipped, and a local probe of the Debian binary rejects -plugin outright). So the icount-ratchet job now builds qemu-hexagon from the pinned QEMU 8.2.2 release with --enable-plugins, linux-user target only — measured ~4 minutes, cached thereafter, so steady-state cost is zero.

Bootstrap expectations (deliberate, will self-resolve in this PR)

The first CI run will fail the ratchet job twice over, by design:

  1. No Hexagon baselines exist yet — the script prints the measured counts and exits nonzero.
  2. The qemu source pin is empty — the run prints the hash to pin.

I'm watching the PR: once that run reports, I'll commit the printed baselines + both pins, and the second run should go green with Hexagon fully gated. Determinism on the Hexagon leg will be confirmed by comparing the bootstrap run's counts against the verification run's.

Validated locally end to end (configure flags, flex/bison deps, plugin acceptance on the built binary) except the cross-compiled workloads themselves — CodeLinaro is unreachable from the dev sandbox, which is exactly why the baselines bootstrap through CI.

https://claude.ai/code/session_01HuAFfoeD5a5Xe5aGNA16M9


Generated by Claude Code

claude added 4 commits June 10, 2026 12:42
Neither Debian's qemu-user nor the CodeLinaro toolchain's bundled
qemu-hexagon enables TCG plugins, so the icount-ratchet job now builds
qemu-hexagon from the pinned QEMU 8.2.2 release with --enable-plugins
(linux-user target only, ~4 minutes, cached thereafter; source
checksum printed for hard-pinning, same bootstrap as the toolchain
pin). The Hexagon ratchet step loses continue-on-error: its first run
fails with the measured counts, which then get committed as baselines.

Build recipe validated locally end to end except the cross-compiled
workloads (CodeLinaro is unreachable from the dev sandbox).
The probe trusted the exit code, but qemu-hexagon exits 1 both with
and without plugin support when no guest binary is given (the
distinguishing signal is the "unknown option" error text). Run #24
proved the from-source build works — it linked qemu-hexagon and
hashed the source — and then failed only on this probe. Also assert
the built binary exists before probing, and pin QEMU_SRC_SHA256 from
that run.
Run #26 passed the plugin probe but found no cross compiler under
~/hexagon despite a successful 722 MB cache restore, while the same
key and lookup work in the hexagon-qemu job. Drop -type f (a
symlinked compiler would be invisible to it), assert on the find
result instead of dirname's never-empty output (also fixed in
hexagon-qemu, where test -n "." could never fail), and dump the tree
on failure so the next run tells us what actually got restored.
hexagon-unknown-linux-musl clang 19.1.5 at -O2 under the from-source
plugin-enabled qemu-hexagon 8.2.2. The numbers invert the M55 story:
float costs ~3.3x the instructions of Q15 (soft-float doubles, no
double FPU), confirming the fixed-point datapaths as the
performance-appropriate formats on this target.
@tap
tap merged commit 8d3510a into main Jun 10, 2026
22 checks passed
@tap
tap deleted the claude/hexagon-icount branch June 27, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants