Skip to content

feat: split compile-profile phases and add Tier-1 matrix (#735) - #1350

Merged
godofecht merged 8 commits into
mainfrom
cursor/compile-profile-gaps-735-8206
Oct 6, 2026
Merged

godofecht merged 8 commits into
mainfrom
cursor/compile-profile-gaps-735-8206

Conversation

@godofecht

@godofecht godofecht commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Part of #735 (parent #727). First slice landed in #1343.

Split monomorphize and lowering out of codegen, add an incremental_cache phase row, emit a Tier-1 measurement matrix from compile_bench, and attach follow-up issue links for every >10% bottleneck.

Overlap check

  • I searched open pull requests and recent commits for overlapping work.
  • This does not duplicate another active implementation, or the relationship is explained below.

Overlap / dependency notes:

Evidence

Baseline before this change:

  • monomorphize and lowering were present in the JSON with 0 ms (still inside codegen).
  • Incremental AST cache hits were counted as parse.
  • No Tier-1 matrix object and no linked follow-ups for >10% phases.

Targeted proof that exercises the changed behaviour:

env -u FLOWC_IN -u FLOWC_OUT "$(./flow tool compiler/scripts/flowc_host.flow)"
# type_id_ok=1 rt_summary_ok=1 profile_ok=1 / flowc: PASS

./flow tool tests/scripts/compile_profile.flow
# 5 passed (profile JSON, off by default, compile_bench phases, split_and_cache, no Python)

./flow tool wiki_nav
# nav is consistent with docs/

./flow tool compile_bench --compiler "$(./flow tool compiler/scripts/flowc_host.flow)" --repeat 2 examples/basics/hello_world.flow
# phases include monomorphize/lowering/incremental_cache with nonzero us
# matrix tier1_slot=linux-x86_64; bottlenecks: cc→#728, emit→#729, import_resolution→#736

Repository gate(s) run:

  • Host compiler selftest (flowc: PASS, profile_ok=1)
  • ./flow tool tests/scripts/compile_profile.flow (5 passed)
  • ./flow tool wiki_nav (consistent)
  • ./compiler/scripts/bootstrap_from_c.sh --regen (fixed point at gen2)
  • ./compiler/scripts/bootstrap_from_c.sh --verify (PASS bootstrap C matches compiler/src)

Generated/bootstrap state, if any:

  • compiler/bootstrap/flowc_stage_a.c regenerated to a fixed point and committed separately (fix: regenerate bootstrap C after compile-profile phase split).

Risk

Compatibility, performance, security, lifetime, backend, or release implications:

  • Opt-in only. Phase ids 0–7 stay stable; incremental_cache is id 8.

  • codegen no longer includes the nested mono/lowering spans.

  • compile_bench summary gains matrix/bottleneck fields; existing keys stay.

  • No unresolved language/API design decision is being implemented implicitly.

  • No unrelated generated artifacts or local state are included.

  • Docs changed when user-visible behaviour or syntax changed.

  • docs/project/Questions.md updated if this needs a language-design decision.

Compatibility

  • No user-visible compatibility change.
  • Compatibility change is documented in docs/project/CHANGELOG.md.

Additive profile phases and compile_bench matrix fields are noted under Unreleased.

Remaining gaps

Part of #735. Still open after this slice:

Agent handoff

Agent/provider/session: Cursor cloud agent, branch cursor/compile-profile-gaps-735-8206.

Open in Web Open in Cursor 

cursoragent and others added 8 commits October 5, 2026 11:46
Time monomorphize and lowering apart from codegen, count AST cache
probes as incremental_cache, and have compile_bench emit a Tier-1
matrix row plus >10% bottleneck follow-ups.

Co-authored-by: Abhishek Shivakumar <[email protected]>
The Flow helper collided with the static flowc_prof_ns[N] timer array
in the profile embed, so the host compiler failed to build.

Co-authored-by: Abhishek Shivakumar <[email protected]>
The identifier linux is a predefined macro on this host, so the
Tier-1 slot helper failed to compile.

Co-authored-by: Abhishek Shivakumar <[email protected]>
…erate bootstrap

Conflicts: compiler/bootstrap (took main's, then bootstrap_from_c.sh
--regen, fixed point at gen2 on macOS and Linux x86-64; checked-in
flowc_stage_a rebuilt for Linux x86-64 like main's) and
docs/project/CHANGELOG.md (kept main's entries and this PR's).
@godofecht
godofecht merged commit 3d42d4d into main Oct 6, 2026
42 checks passed
godofecht added a commit that referenced this pull request Oct 6, 2026
Only compiler/bootstrap/flowc_stage_a conflicted (after #1350); took main's binary (C already matches).
godofecht added a commit that referenced this pull request Oct 6, 2026
Bring #1350 compile-profile changes onto the cold-start compare branch,
restore --python-code / python_ms emission lost in the merge, and regen
bootstrap (Linux x86-64 ELF) to the fixed point.
godofecht added a commit that referenced this pull request Oct 6, 2026
Tree already contained the #1350 compile-profile work from the prior
content merge; this commit records the real merge so the branch is up
to date with main. Keep --python-code/python_ms and the regenerated
Linux bootstrap.
@godofecht
godofecht deleted the cursor/compile-profile-gaps-735-8206 branch October 12, 2026 23:02
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