Skip to content

Clean compiler phase boundaries - #83

Merged
itsfuad merged 24 commits into
mainfrom
fix/compiler-phase-boundaries
Aug 22, 2026
Merged

Clean compiler phase boundaries#83
itsfuad merged 24 commits into
mainfrom
fix/compiler-phase-boundaries

Conversation

@itsfuad

@itsfuad itsfuad commented Aug 21, 2026

Copy link
Copy Markdown
Member

Summary

  • preserve source-written HIR control flow through mandatory semantic checks
  • represent uninitialized HIR bindings without fake invalid expressions
  • finalize typed CFG edges and CFG diagnostics inside PhaseCFG
  • move definite initialization from Resolver into CFG dataflow
  • separate ownership cleanup output from immutable CFG
  • add typed semantic export fingerprints and dependent invalidation
  • clarify eager semantic const evaluation versus typed HIR folding

Validation

  • GOCACHE=/tmp/peeper-go-cache CCACHE_DISABLE=1 go test ./... -count=1
  • GOCACHE=/tmp/peeper-go-cache CCACHE_DISABLE=1 go vet ./...
  • GOCACHE=/tmp/peeper-go-cache CCACHE_DISABLE=1 go test -race ./... -count=1
  • GOCACHE=/tmp/peeper-go-cache CCACHE_DISABLE=1 go run ./scripts/bundle.go
  • PEEPER_BIN=/home/itsfuad/Dev/Peeper/compiler/build/bin/peeper go test ./x_test -count=1

Tracking

Progresses #28 by establishing CFG and flow boundaries required for optional narrowing.

Future constraints

  • Optional narrowing remains out of scope for this PR.
  • No optimization may remove source-written control flow before mandatory semantic analyses finish.
  • Ownership remains on typed HIR-derived CFG for now; Raw MIR ownership is a later architecture decision.
  • Semantic API equality must continue to imply equal compiler-visible public interface.

Keep source-written control flow through mandatory analyses and represent legal uninitialized bindings without fake invalid expressions.
Preserve edge meaning, keep disconnected source syntax, and complete CFG validation before ownership.
Keep syntax fingerprints for conservative workspace reuse, then compare typed public API fingerprints between scheduler batches before retaining dependent phases.

Semantic serialization helpers centralize recursive type, declaration metadata, and constant identity. Scheduler invalidation helper protects parallel phase boundaries; context accessors protect shared baseline state.
Define const-eval as an eager semantic prepass with expected-type queries during typechecking, then finalize module const caches before semantic export fingerprinting.

FinalizeValues protects final symbol-type/cache identity while reusing the canonical evaluator and preserving local const facts.
@itsfuad itsfuad added this to the 0.2 Language Foundations milestone Aug 21, 2026
@itsfuad
itsfuad merged commit fe2f518 into main Aug 22, 2026
4 checks passed
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