Immutable representation of compiled interfaces - #8676
Closed
fhammerschmidt wants to merge 2 commits into
Closed
fhammerschmidt wants to merge 2 commits into
fhammerschmidt wants to merge 2 commits into
Conversation
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
fhammerschmidt
added this pull request to stack #8668
September 25, 2026 21:24
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## faster-rewatch-ocaml-project-session #8676 +/- ##
========================================================================
- Coverage 78.40% 78.18% -0.22%
========================================================================
Files 481 485 +4
Lines 65729 66992 +1263
========================================================================
+ Hits 51537 52381 +844
- Misses 14192 14611 +419
🚀 New features to boost your workflow:
|
Member
Author
|
Superseded by consolidated PR #8680, which preserves this work as one commit in the combined review branch. |
fhammerschmidt
removed this pull request from stack #8668
September 26, 2026 17:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Frozen_type_graph, an immutable indexed type arena with request-local views that materialize only reached mutable types while preserving graph sharing and cycles.Frozen_values, an immutable index for exported values, types, constructors, labels, modules, and module types. WhenREWATCH_FROZEN_VALUES=1, a project cache shares images across compiler domains and each request owns its materialized declarations.Envto avoid expanding an imported module just to look up selected members. Unsupported shapes retain request-owned fallback paths.Status and measurements
This is an opt-in experiment; the flag is off by default and the CMI file format is unchanged. On five short synthetic fixtures with four compiler domains, median clean-build time fell from 184.54 to 165.14 ms for abstract types, 170.75 to 165.17 ms for values and records, 192.54 to 162.64 ms for variants, 169.22 to 144.67 ms for modules, and 174.07 to 151.84 ms for opened imports. These measurements are directional and do not establish a production-project speedup.
Selected generated artifacts matched byte for byte in the measured fixtures. Switching the flag can change an internal identifier stamp in a consumer CMI, and therefore its self CRC, even when exported declarations and JavaScript agree; this may cause downstream rebuilds. Larger projects, edit workloads, and fallback frequency still need validation before enabling the flag by default.
Stack
Depends on #8675.
Validation
make checkformatmake testmake test-rewatch