Skip to content

OCaml rewatch performance and immutable interfaces - #8680

Draft
fhammerschmidt wants to merge 35 commits into
rewatch-ocamlfrom
rewatch-ocaml-consolidated
Draft

fhammerschmidt wants to merge 35 commits into
rewatch-ocamlfrom
rewatch-ocaml-consolidated

Conversation

@fhammerschmidt

@fhammerschmidt fhammerschmidt commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Summary

This PR consolidates the OCaml Rewatch experiment into one reviewable stack, with one commit for each previously opened PR and the follow-up implementation work on top.

The changes improve incremental build performance and make the project the compiler's lifetime boundary. Rewatch now reuses compiler sessions, signatures, and runtime CMIs where possible, tracks build freshness and compiler configuration explicitly, and supports an immutable representation of compiled interfaces behind REWATCH_FROZEN_VALUES=1.

The latest follow-up work completes the build lifecycle changes and keeps compatibility file copies explicit. The normal build path avoids legacy source and generated-output copies; compatibility fixtures can opt in with REWATCH_COMPAT_COPIES=1. Compiler metadata records this mode so changing it invalidates stale artifacts correctly.

Commit structure

  1. Improve OCaml Rewatch performance and benchmarking (from Improve OCaml rewatch performance and benchmarking #8671)
  2. Add exclusive compiler phase tracing (from Add exclusive compiler phase tracing for OCaml rewatch #8672)
  3. Reuse compiler signatures and runtime CMIs (from Reuse compiler signatures and runtime CMIs in OCaml rewatch #8673)
  4. Make the project the compiler lifetime boundary (from Make the project—not the module—the compiler’s lifetime boundary #8675)
  5. Add an immutable representation of compiled interfaces (from Immutable representation of compiled interfaces #8676)
  6. Continue the immutable-interface experiments with broader compiler-state and session coverage
  7. Advance the Rewatch lifecycle and tooling performance
  8. Gate compatibility copies behind an explicit mode

Validation

  • make checkformat
  • make test
  • make test-rewatch
  • OCaml Rewatch integration tests, including changed interfaces after failed implementations

Supersedes

#8671, #8672, #8673, #8675, and #8676 are represented in this single review. This PR is stacked directly on #8653 (rewatch-ocaml), which remains the separate “Rewrite Rewatch in OCaml” review.

codex and others added 28 commits September 25, 2026 10:13
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
@fhammerschmidt
fhammerschmidt force-pushed the rewatch-ocaml-consolidated branch from 9a5ae61 to bf921de Compare September 26, 2026 17:58
@fhammerschmidt
fhammerschmidt changed the base branch from rewatch-ocaml to immutable-compiled-interfaces September 26, 2026 17:58
@fhammerschmidt
fhammerschmidt changed the base branch from immutable-compiled-interfaces to codex/stabilize-rewatch-tests September 26, 2026 17:59
@fhammerschmidt
fhammerschmidt added this pull request to stack #8668 September 26, 2026 17:59
@fhammerschmidt
fhammerschmidt removed this pull request from stack #8668 September 26, 2026 18:04
@fhammerschmidt
fhammerschmidt changed the base branch from codex/stabilize-rewatch-tests to master September 26, 2026 18:05
@fhammerschmidt
fhammerschmidt changed the base branch from master to rewatch-ocaml September 26, 2026 18:08
@fhammerschmidt
fhammerschmidt added this pull request to stack #8681 September 26, 2026 18:08
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>

This branch has not been deployed

No deployments
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