Repository navigation
Claude/fork precompile - #3931
Merged
Merged
Conversation
…guages before a fork
A/B on the crucible corpus (3 alternating rounds, A-vs-A control +-0.3%)
measured the lazy registry at +2.4% wall / +0.8% detector phase:
- _compiled_rules rescanned a language's rules on every per-segment lookup;
each extractor now memoises the rule dicts it has compiled (non-empty ones:
a temporary `{}`'s id can be reused).
- a forked pool's workers inherited nothing compiled, so each compiled every
language it met; the parent now compiles the scan's active languages (the
ones _init_worker warms, now one shared _active_languages helper) once
before a fork. Spawned pools are left alone: their state comes from
pickles, where a pattern travels as its source.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01X9PBcL8evG7CEzff1zE8v5
… wall `wall` is the engine's own PIPELINE_SUCCESS duration, timed inside the scan: it excludes the import. #3914 moved rule compilation from the import (uncounted) into the scan (counted), so `wall` charged the lazy registry for work the baseline did before its clock started. `process` times the whole subprocess, the import included -- what a user waits for -- and is reported beside `wall`, per round and in the means. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01X9PBcL8evG7CEzff1zE8v5
Contributor
The language lens's lexical scan runs every rule of every language that claims an ambiguous extension (`.h`: c and objective-c). Pre-compiling only each extension's first claimant left objective-c to every forked worker -- each compiled it (0.44 s) the first time it met a header: the 3_Language_Detector CPU rise #3929 measured on curl. On the crucible corpus a compile trace now shows forked workers compiling 0.012 s in total (was 0.5 s), the parent compiling the 55 active languages once. _init_worker still warms an extractor for first claimants only. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01X9PBcL8evG7CEzff1zE8v5
4 of 8 tasks
3 tasks
Owner
Author
|
Outcome: this fixed large scans but made small ones slower. #3939 completes it. This merged at Three-way
Why the ungated pre-compile loses on small scans:
What held up from this PR:
Outputs are identical throughout. Generated by Claude Code |
This was referenced Sep 27, 2026
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.
Description
Core Engine Modification Checklist
If your PR changes the core parsing engine (
language_standards.py,detector.py,prism.py), you MUST complete the following validation gauntlet before merging:crucible_check.pyto verify diffs, and rancrucible_check.py --update --yesif the baseline changed due to intentional parsing improvements.python tests/tools/tri_comparison_chart.py --all --cilocally first. If you intentionally improved precision, regenerate the baseline:python tests/tools/tri_comparison_chart.py --regenerate --languages <lang>.python tests/tools/tree_sitter_accuracy_audit.py --ci --all. If ground truth drifted for valid reasons, regenerated the baseline withpython tests/tools/tree_sitter_accuracy_audit.py --regenerate --lang <lang>.