Skip to content

docs(audit): CAKE assessment + Phase 1/2 scoping for the Tile sync surface - #562

Merged
gstoner merged 2 commits into
mainfrom
agent/cake-compiler-enhancement-assessment
Aug 15, 2026
Merged

gstoner merged 2 commits into
mainfrom
agent/cake-compiler-enhancement-assessment

Conversation

@gstoner

@gstoner gstoner commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Assesses CAKE: Compiler–Agent Co-Design for Frontier Kernel Evolution (arXiv:2608.12629, NVIDIA/CMU) and its FlashInfer PR #4262 artifact against the tree at f96695f. Adds docs/audit/compiler/compiler_enhancement.md in the house assessment style (alongside TILESIGHT/TILERT/SPARDA), reference role — not a status surface (Decision #26).

Docs only. No code paths touched.

Why it matters

CAKE is the first controlled A/B on IR design as agent ergonomics: same model, scaffold, oracle, token budget, GPU, and task — the only variable is the representation the agent edits. That is a question Tessera has answered by assertion since Decision #28.

Statistical audit (§2)

Because n=3 and the paper reports median [min,max], the reported triple is the complete sample, so exact permutation tests apply.

Metric CAKE IR Direct CUDA/PTX Exact one-sided p
Best speedup @ 80M {1.041, 1.144, 1.205} {0.852, 0.928, 1.151} 0.200
Active evolve time (h) {1.02, 1.89, 2.33} {3.59, 3.73, 4.34} 0.050
Plateau by 80M 3/3 0/3 0.050 (Fisher)

The headline 1.144× vs 0.928× is not significant — the arms overlap; the control's best run (1.151) beats the treatment median (1.144). The design's Bonferroni family-wise floor is 0.15, so no effect size could have made it significant. What is separated is convergence: half the wall-clock, complete separation, 3/3 vs 0/3.

This reshapes the plan. The paper's own curve crosses baseline only at 55M tokens — an order of magnitude above a realistic per-kernel budget here — so an authoring surface must be justified on time-to-plateau and convergence, never on the speedup number.

In-tree findings (§3, measured against f96695f)

  • F1 — the typing hole is on the sync/memory surface. 55 of 74 Tile op defs carry AnyType in their arguments; only 8 use a declared Tile_* type. Sharpest defect: tile.mbarrier.wait cannot consume the !tile.mbarrier_token that tile.mbarrier.arrive_expect_tx produces, so the arrive→wait edge is not expressible in the type system — while tile.try_wait, four lines away in the same file, already has the correct form. Also: tile.pipeline_advance need not consume a pipeline_state, though Tile_PipelineStateType's own summary claims SSA def-use ownership (Decision Apple GPU MLA: native f16/bf16 for the absorbed decode kernel #29 stated and violated in one file).
  • F2 — WarpSpecLegalityPass is type-blind by construction. It matches on name substrings and attributes and never reads an operand type (Decision Apple GPU MLA: native f16/bf16 for the two secondary decode kernels #30, one level below the EffectLattice instance CLAUDE.md already indicts). Tightening ODS buys the verifier nothing on its own — which is why Phase 1 is one phase, not two. Separately, the legality fixtures run under --allow-unregistered-dialect while the fixtures exercising the registered vocabulary don't run the legality passes: the registered path and the verified path are disjoint sets.
  • F3 — no author can state a schedule. tessera.kernel is a shard decorator; tile_ir.py is a lowering; barriers and TMEM are synthesized per-arch by target_ir.py from a tile.matmul.

Relationship to W1.1 (§3.5)

Scoping changed once W1_1_TYPING_DESIGN.md was read — steps 1, 2, 4 landed, 3 partial. Nothing here duplicates it. W1.1 owns !tile.fragment / tile.mma / producer migration / Target IR dialects; this doc owns tile.mbarrier.*, tile.tma.*, tile.tmem.*, tile.pipeline_*. tile.tcgen05.mma is the seam and is deferred until after W1.1 step 5 so it doesn't fork the fragment contract.

Phase 1 also inherits W1.1's four method lessons rather than rediscovering them — notably §4.2 (both backends materialized a zero constant for the MMA's C operand, so a lowering fixture passed a silently wrong GEMM). Hence the exit gates require numerical execution on gfx1151, not a lowering fixture.

What's scoped

  • Phase 1 — one typed, verified sync surface: hardest-case-first experiments, 8 ordered ODS rows, verifier rewrite to derive from types and def-use, fixture migration off --allow-unregistered-dialect, 6 exit gates.
  • Phase 2 — roles and producer/consumer sets on the barrier declaration (the smallest load-bearing idea in the paper), consuming wave_specialization.py instead of leaving it a declaration with no consumer.
  • Phases 3–6 sketched behind the gates Phase 1/2 must produce.
  • §8 — the capability layer beyond CAKE, led by schedule-level autodiff (CAKE hand-authors FA4 BWD as 514 lines).

Also corrects an earlier arbiter proposal: emit/candidate.py:365 does min(cands, key=measure), so measure is the terminal selector — wiring a predictor into it leaves regret unbounded. The two-stage form is gated on first instrumenting the rejection fraction p, which CAKE never reports.

Deliberately unresolved

§5.1's experiments haven't been run (they're Phase 1's first work item because their outcome could invalidate ODS rows 6–7), and Phase 2 gate 2 — whether one role model verifies both Hopper producer/consumer and CDNA ping-pong without a target branch — is flagged as a genuine open question. §9 records the assessment's own limits, including that the AnyType count is ODS-derived and therefore an upper bound on the hole.

Verification

🤖 Generated with Claude Code

…rface

Assess CAKE (compiler-agent co-design, arXiv:2608.12629) and the FlashInfer
PR #4262 artifact against the tree at f96695f. `reference` role, not a status
surface.

Statistical audit of the paper's clean-start A/B. Because n=3 and the paper
reports median [min,max], the reported triple is the complete sample, so exact
permutation tests apply. The headline 1.144x vs 0.928x is NOT significant
(one-sided exact p = 0.200; the arms overlap -- the control's best run beats
the treatment median). What IS separated is evolve time (p = 0.050, complete
separation) and plateau rate 3/3 vs 0/3 (Fisher, p = 0.050). The design's
family-wise floor is 0.15, so no effect size could have made it significant.
Supported claim is convergence, not ceiling -- which matters here because the
paper's own curve crosses baseline only at 55M tokens, an order of magnitude
above a realistic per-kernel budget.

Three in-tree findings the read surfaced:

* F1 -- 55 of 74 Tile op defs carry AnyType in their arguments; only 8 use a
  declared Tile_* type. The hole sits on the sync/memory surface.
  tile.mbarrier.wait cannot consume the !tile.mbarrier_token that
  tile.mbarrier.arrive_expect_tx produces, so the arrive->wait edge is not
  expressible; tile.pipeline_advance need not consume a pipeline_state, though
  Tile_PipelineStateType's own summary claims SSA def-use ownership
  (Decision #29 stated and violated in one file).
* F2 -- WarpSpecLegalityPass is type-blind by construction, matching on name
  substrings and attributes and never reading an operand type (Decision #30,
  one level below the EffectLattice instance). Tightening ODS buys the verifier
  nothing on its own, which is why Phase 1 is one phase and not two. The
  legality fixtures also run under -allow-unregistered-dialect while the
  fixtures exercising the registered vocabulary do not run the legality passes
  -- the registered path and the verified path are disjoint.
* F3 -- no author can state a schedule; barriers and TMEM are synthesized
  per-arch by target_ir.py lowering from a tile.matmul.

Scopes Phase 1 (typed + derived sync surface) and Phase 2 (roles and
producer/consumer sets on the barrier), with Phases 3-6 sketched behind the
gates that Phase 1/2 must produce. Section 3.5 draws the boundary against the
in-flight W1.1 typing workstream so nothing here duplicates it, and inherits
its four method lessons -- notably that only numerical execution catches the
wrong-answer failure mode, so the exit gates require gfx1151.

Corrects the arbiter proposal: emit/candidate.py's `measure` is the terminal
selector, so wiring a predictor into it leaves regret unbounded. The two-stage
form (predict -> prune -> measure -> select) is gated on first instrumenting
the rejection fraction, which CAKE never reports.

Docs only; no code paths touched. check_generated_docs.sh: 25 in sync.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d56d5ba832

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/audit/compiler/compiler_enhancement.md Outdated
Comment thread docs/audit/compiler/compiler_enhancement.md
Comment thread docs/audit/compiler/compiler_enhancement.md Outdated
Comment thread docs/audit/compiler/compiler_enhancement.md Outdated
Comment thread docs/audit/compiler/compiler_enhancement.md Outdated
…te scope

Four review findings, all correct on the merits.

1. Classify as `plan`, not `reference`. Sections 5-6 carry owners, ordered
   steps, stop conditions, and exit gates, so `reference` bypassed the plan
   lifecycle and the scoped-plan routing gate
   (test_scoped_compiler_plans_defer_global_order_to_integrated_plan only
   inspects audit_role: plan). House precedent is SPARDA_REVIEW.md -- an
   external review that scopes extraction work -- which is plan/open. Adds
   plan_state: open and a header block deferring global order and fleet
   allocation to INTEGRATED_COMPILER_PLAN.md, and noting both phases still
   need an owning work-item ID there before implementation starts.

2. Reconcile the convergence claim with multiplicity (2.3). The draft asserted
   convergence as the supported conclusion one section after establishing a
   family-wise floor of 0.15. Both convergence metrics are p = 0.05 unadjusted,
   so neither clears 0.05 after correction; Holm rejects nothing (sorted
   0.05/0.05/0.20 against alpha/3 = 0.0167 fails at the first step). Also
   records that no primary endpoint is prespecified, so picking the two metrics
   that separate is post-hoc, and that evolve time and plateau are not
   independent, so Bonferroni is conservative for that pair but not by enough.
   Reframed as unadjusted exploratory evidence plus a descriptive ordering.
   2.4's planning consequence is unchanged and re-stated as a Phase 3 gate --
   it never depended on a significance threshold.

3. Recount all Tile op definitions (3.2). The scan enumerated only four of the
   six op bases, dropping Tile_LinalgOp (6) and Tile_ControlOp (4), and the
   direct-Tile_Op count used a single-line regex that missed the multi-line
   `def X\n    : Tile_Op<...>` form. Corrected: 82 ops, not 74; 63 declare
   their own `let arguments` and are the correct denominator; 55 of 63 (87%)
   carry AnyType -- a worse ratio than the reported 55/74. An explicit,
   reproducible inclusion rule is now stated. The four Tile_ControlOp ops are
   not among the 55, and the note records that AnyType on control-flow
   iter_args would have been legitimate polymorphism per W1.1 step 6.

4. Make the provenance gate verifier-based (5.5). A mandatory !tile.mbarrier
   operand constrains the shape of a value, never its origin -- a function
   argument or loop-carried block argument of that type satisfies ODS
   completely. The draft contradicted itself, since the loop-carried case is
   the exact shape 5.1 exists to investigate. Gate 1 is now operand shape only;
   provenance moved to gate 2 as def-use reachability that must resolve across
   a block-argument edge, failing closed when it cannot.

tests/unit/test_audit_docs.py: 11 passed. check_generated_docs.sh: 25 in sync.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@gstoner
gstoner merged commit ce74370 into main Aug 15, 2026
18 checks passed
@gstoner
gstoner deleted the agent/cake-compiler-enhancement-assessment branch August 15, 2026 15:46
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.

1 participant