Repository navigation
Conversation
cknitt
added this pull request to stack #8782
October 10, 2026 16:36
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## rewatch-ocaml-port #8781 +/- ##
======================================================
+ Coverage 80.66% 80.74% +0.07%
======================================================
Files 463 468 +5
Lines 62792 63575 +783
======================================================
+ Hits 50651 51331 +680
- Misses 12141 12244 +103
🚀 New features to boost your workflow:
|
cknitt
force-pushed
the
rewatch-ocaml-in-process
branch
from
October 10, 2026 17:56
2cb5e55 to
236cf9b
Compare
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
compiler-info.json records the bundled bsc.exe again, which editor tooling uses to find the platform binaries. RESCRIPT_BSC_EXE only affects Rust. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Concurrent requests shared the counter and could reuse a name within one exhaustiveness check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Ctype's abbreviation memos and levels, and PPX cookies, now start fresh for each request. Parser hooks are installed once; Typetexp's unused pre_univars is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
cknitt
force-pushed
the
rewatch-ocaml-in-process
branch
from
October 10, 2026 18:59
236cf9b to
3de8d08
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
The formatter emits CRLF on Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
On Windows this gives the same CRLF line endings as a bsc process. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Concurrent requests mixed their sets, so Js_shake could drop a live function definition. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Not reached concurrently today; same pattern as the Js_analyzer race. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Windows rejects locking an unbounded range. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Request_local keys get a fresh value per request and are restored after it, replacing the per-module with_fresh and reset functions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
macOS can deliver both edits in one batch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
This branch has not been deployed
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.
Stacked on #8780.
This PR moves compilation into the OCaml rewatch process. Instead of starting
bscfor every parse and compile,rescriptlinks the compiler and runs requests on a bounded pool of OCaml 5 domains. That removes process start-up and pipe handling, which make the subprocess port about 6% slower than Rust on clean builds. It also opens the door to sharing compiler state between requests later.Changes
Js_config, warnings, environment and CRC caches, predefined types,Identstamps, printers, diagnostics and backend caches move into domain-local state. Almost all of it lives inRequest_localkeys: every request starts with fresh values, as a newbscprocess would, and the previous values are restored afterwards. OnlyIdentstamps, the request context, output capture and the order-sensitive predefined types keep explicit handling. The driver moves fromrescript_compiler_main.mltorescript_compiler_driver.ml, sobscand rewatch share it.bsc's CRLF line endings.REWATCH_COMPILER_DOMAINSoverrides it. Artifact publication stays on the scheduling domain. PPXs and hooks still run as external processes.rescript formatalso runs on the embedded compiler. PPXs,js-post-build,--after-buildand the lock-owner check are the only remaining subprocesses.RESCRIPT_BSC_EXEnow only affectsrescript-rust, and CONTRIBUTING.md says how to test a local compiler instead.lib/bs/compiler-info.jsonstill records thebsc.exeshipped next torescript.exe. The VS Code extension readsbsc_pathto findbsc.exeand the other platform binaries.Known issues before this can leave draft
An earlier domain build once produced a differing output that was never explained. Review since found and fixed shared or leaked state:
Js_analyzer's free-variable accumulator was shared between domains, soJs_shakecould drop a live function definition; this reproduced once in CI;Parmatch.Conv's name counter,Ctype's abbreviation memo and levels, PPX cookies and the parser hooks for error messages.An audit of top-level mutable records, visitors and tables found no other live case. Regression tests cover the
Js_analyzerrace and the leakedCtypememo.No ThreadSanitizer run over a parallel build yet.
bscnow buffers its output until exit. Diagnostics no longer stream, and warnings already emitted are lost if an internal compiler error escapes.The focused suite's slow-compiler cases no longer apply; signal handling is covered through a slow
js-post-buildhook instead.Tests
tests/rewatch_ounit_tests/compiler_driver_tests.mlchecks that each kind of request-scoped state is isolated between consecutive and concurrent requests.rewatch-ocaml/benchcompares clean-build artifacts across domain counts; it does not run in CI.🤖 Generated with Claude Code