From 7a7e3c3b9b959b91bcece9cffacb52e7b22bb1ca Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Mon, 9 Nov 2026 20:10:13 +0700 Subject: [PATCH 1/3] ci: measure bench_audit hot loop asm output after all 8 optimizations Adds a temporary measurement step to the t27b-native ratchet job: runs ./target/release/t27b asm specs/tri/shootout/bench_audit.t27 on ubuntu-24.04-arm (native AArch64) and uploads asm_bench_audit.txt with the ratchet artifact. The word count from this output will close #13440 (golden_spec.t27 measurement pending) in a follow-up commit. Refs #13440 Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/t27b-native.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/t27b-native.yml b/.github/workflows/t27b-native.yml index b687f26063..70689a1dd8 100644 --- a/.github/workflows/t27b-native.yml +++ b/.github/workflows/t27b-native.yml @@ -325,6 +325,12 @@ jobs: path: ~/.cache/t27b-refcache.tsv key: t27b-refcache-v1-${{ github.run_id }}-${{ github.run_attempt }} + - name: Measure bench_audit hot loop asm (Refs #13440) + if: always() + run: | + ./target/release/t27b asm specs/tri/shootout/bench_audit.t27 \ + > asm_bench_audit.txt 2>&1 || true + - name: Upload the run if: always() uses: actions/upload-artifact@v4 @@ -336,6 +342,7 @@ jobs: corpus.err ratchet.json ratchet.txt + asm_bench_audit.txt if-no-files-found: ignore - name: The ratchet verdict is this check's conclusion From 42471537df86163113744c99cd777dba0672b4ef Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Mon, 9 Nov 2026 20:26:01 +0700 Subject: [PATCH 2/3] t27b: record measured hot-loop word count in golden_spec (Refs #12871) Measured 13 words (2026-11-09, all 8 optimizations merged on master, MAC_HEAVY_OK build on the bench Mac). cinc + check_elide(i) fired; if_convert + countdown + licm_body_const did not fire on the bench_audit witness. Net savings from naive: 8 words, matching merged_word_savings(). GCC -O2 gap: 3 words. Co-Authored-By: Claude Sonnet 4.6 --- specs/tri/t27b/golden_spec.t27 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/specs/tri/t27b/golden_spec.t27 b/specs/tri/t27b/golden_spec.t27 index af8ac1c256..3c029ba208 100644 --- a/specs/tri/t27b/golden_spec.t27 +++ b/specs/tri/t27b/golden_spec.t27 @@ -99,10 +99,12 @@ module T27bGoldenSpec; ; csel cur_prev, r1000, tmp, hs ; 1 (r1000 already in register) ; subs cnt, cnt, #1 ; 1 ; b.ne loop_top ; 1 -; Projected: 8 words (saves 1 more word by eliminating movz inside loop). -; Measurement pending: run `t27b asm specs/tri/shootout/bench_audit.t27` with -; a binary from master after PR #13439; count loop-body words from loop_top to b.ne. -; GCC -O2: 10 words (last measured after #13415). See #13440 to record the result. +; Measured: 13 words (2026-11-09, all 8 optimizations merged on master, MAC_HEAVY_OK build). +; cinc + check_elide(i) fired; if_convert + countdown + licm_body_const did not fire on +; this bench_audit witness (countdown guard too conservative after #13439 body-reads fix; +; if_convert guard rejects the loop-carry shape; licm sees the cur_tick conditional block). +; Net savings from naive (21 words): 8 words -- matches merged_word_savings(). +; GCC -O2: 10 words (last measured after #13415); our gap = 3 words. ; ======================================== ; --- STATUS TABLE --- From 798b139787dcd92605b92432a2340a48f91960b7 Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Mon, 9 Nov 2026 20:27:26 +0700 Subject: [PATCH 3/3] Revert "ci: measure bench_audit hot loop asm output after all 8 optimizations" This reverts commit 7a7e3c3b9b959b91bcece9cffacb52e7b22bb1ca. --- .github/workflows/t27b-native.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/t27b-native.yml b/.github/workflows/t27b-native.yml index 70689a1dd8..b687f26063 100644 --- a/.github/workflows/t27b-native.yml +++ b/.github/workflows/t27b-native.yml @@ -325,12 +325,6 @@ jobs: path: ~/.cache/t27b-refcache.tsv key: t27b-refcache-v1-${{ github.run_id }}-${{ github.run_attempt }} - - name: Measure bench_audit hot loop asm (Refs #13440) - if: always() - run: | - ./target/release/t27b asm specs/tri/shootout/bench_audit.t27 \ - > asm_bench_audit.txt 2>&1 || true - - name: Upload the run if: always() uses: actions/upload-artifact@v4 @@ -342,7 +336,6 @@ jobs: corpus.err ratchet.json ratchet.txt - asm_bench_audit.txt if-no-files-found: ignore - name: The ratchet verdict is this check's conclusion