Skip to content

Build: over-invalidation — build.w-only edits rebuild the full stage chain; regex-runtime-ir built twice #686

Closed

Description

@ehartford

Part of #679. Two independently-observed cache defects (2026-07-17, build-times.tsv + live battery evidence):

  1. A build.w/build/*.w-only edit (no compiler-source change) marked stage1/stage2/link stale and rebuilt the full ~9-min chain — observed directly when adding the :dev group target. Likely cause: the Action cache signature hashes the build source wholesale, so any build-script edit invalidates every Action target including the stage chain. Wanted: signature scoped to the action's own definition/closure, not the whole file. (Same family as Build performance: root-cause why builds are this slow and make them fast (incremental/cached compilation) #650's dependency-rebuilt trap — see decisions.md D13.)

  2. regex-runtime-ir is built twice per cold build (~14.0s bootstrap leg + ~13.5s normal leg, byte-identical inputs) — visible in out/.build-state/build-times.tsv. The bootstrap/normal object pairs (~3s each) are likewise near-duplicates; if their inputs are identical the second leg should be a cache hit or a shared target.

Verify each with the timing TSV before/after; both are pure build-graph work, D14 batch-tier eligible.

Activity

  1. added a commit that references this issue on Jul 18, 2026
  2. ehartford commented on Jul 18, 2026

    @ehartford
    ContributorAuthor

    Over-invalidation half FIXED (c05c560 + 2acd23a): action signatures now hash only the action's module closure (defining file + use closure from Sema's retained module graph, recorded at materialize); stage targets no longer declare build//build.w as inputs; the two root-defined stage-ancestor actions moved to build/runtime.w. Measured: benign build/emit_c.w edit went from a ~10-min stage-chain rebuild to a 19.7s zero-stale sweep. Closure misses fall back to the global hash and self-report. Remaining in this issue: regex-runtime-ir built twice per cold chain (bootstrap+normal legs use different compilers — unifiable only at fixpoint; low value).

  3. added 2 commits that reference this issue on Jul 18, 2026
  4. ehartford commented on Aug 31, 2026

    @ehartford
    ContributorAuthor

    Triage 2026-08-31: CLOSE (overcome by events). Defect 1 landed (c05c560 scopes action signatures to the action's module closure; 19.7s no-op sweep). Defect 2's byte-identical-inputs premise is refuted in docs/build_time_log.md (the two legs use different producer compilers — unifiable only at fixpoint, low value), and D30's in-unit runtime retirement removes those rt-IR targets anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions