Skip to content

Eliminate per-entry reconcile assembly rerun at 100% typed-cache hits - #6562

Merged
briansrls merged 2 commits into
mainfrom
session/loyal-cat-251
Jul 14, 2026
Merged

briansrls merged 2 commits into
mainfrom
session/loyal-cat-251

Conversation

@briansrls

@briansrls briansrls commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Track A resolve-split (#6535) priced reconcile_assembly at ~108s (29% of whole-corpus resolve) — assembly rerunning per entry even when every module was already in typed_module_cache. Two cuts:

  1. Always-on in-process share — resolved_graph_memo was incorrectly gated on GUNBC_RESOLVED_GRAPH_CACHE_DIR; it is now the always-on ReferenceTier in front of the opt-in disk store. Same-subject re-resolves return the assembled graph by reference instead of re-running expand/rewire/emit.

  2. All-cache-hit reconcile fast path — when every module in a closure is already typed, skip the schedule-dispatch loop's collect_parent_envs and build_variant_export_surface (both exist only to feed cold typecheck_module) and jump straight to closure assembly via reconcile_all_cache_hits. Partial-hit dispatches still skip collect_parent_envs on per-module cache hits.

Follows the normalize+ownership memo pattern from #6539 (docs/plans/v1-run-stability-throughline.md §1).

Test plan

  • RUSTFLAGS="-D warnings" cargo build -p v1-compiler --release — green
  • cargo test -p v1-compiler-tests union_resolve_typechecks_each_node_once — green
  • cargo test -p v1-compiler-tests typed_module_cache_matches_cold_oracle_in_every_order — green
  • cargo test -p v1-compiler-tests union_view_result_equals_private_resolve_in_every_order — green
  • CI floor run on this PR (in progress at mark-ready time)

@gunbai-bot gunbai-bot Bot changed the title reconcile_assembly residue: 105-110s (29%) of whole-corpus resolve reruns per entry even at 100% cache hits (Track A denomination receipt, resolve-split #6535, docs/plans/v1-run-stability-throughline.md). Root-cause and eliminate the per-entry assembly rerun — the resolver-graph-major lane's shape ( Eliminate per-entry reconcile assembly rerun at 100% typed-cache hits Jul 14, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 14, 2026 02:33
@briansrls
briansrls merged commit 88ef0a3 into main Jul 14, 2026
4 of 6 checks passed
@briansrls
briansrls deleted the session/loyal-cat-251 branch July 14, 2026 03:26
gunbai-bot Bot pushed a commit that referenced this pull request Jul 14, 2026
…t path.

Keep SharedTypecheckCaches C1-prep shell and process-wide atomic counter; wire main's reconcile_all_cache_hits and skip-parent-envs-on-hit through the shared mutex store.

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request Jul 14, 2026
…rack A receipt, docs/plans/v1-run-stability-throughline.md): design the increment that shares cold typecheck computes across floor workers on Inc B's ModuleInterface/std.interface_summary boundary (#6543, landed neutral — denominat (#6561)

* WIP: Cross-worker typecheck share design increment — the OPEN 52% prize (Trac

* WIP: Cross-worker typecheck share design increment — the OPEN 52% prize (Trac

* WIP: Cross-worker typecheck share design increment — the OPEN 52% prize (Trac

* WIP: Cross-worker typecheck share design increment — the OPEN 52% prize (Trac

* WIP: Cross-worker typecheck share design increment — the OPEN 52% prize (Trac

* Fix CI: replace blocked cross-worker test with process-wide counter receipt.

The shared-cache oracle depends on Rc→Arc migration (§4.1); land a C1-prep test that proves typecheck_compute_count accumulates across threads instead.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Fix SharedTypecheckCaches doc: Rc payloads are !Send until Arc migration.

The C1-prep struct comment incorrectly implied Arc<Mutex<_>> is Send today; align with design §4.1 — cross-thread share lands after store-path Rc→Arc.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Merge origin/main: resolve cli_run conflicts with #6562 reconcile fast path.

Keep SharedTypecheckCaches C1-prep shell and process-wide atomic counter; wire main's reconcile_all_cache_hits and skip-parent-envs-on-hit through the shared mutex store.

Co-authored-by: Cursor <cursoragent@cursor.com>

* WIP: Cross-worker typecheck share design increment — the OPEN 52% prize (Trac

* WIP: Cross-worker typecheck share design increment — the OPEN 52% prize (Trac

---------

Co-authored-by: Brian Searls <briansearls1@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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