feat: isolate symbol and eval runtime state - #925
Merged
Conversation
Implement Perl threads plan phases 8d, 8e, and 9 as the requested combined change while keeping both compiler backends functional and thread feature flags disabled. Phase 8d moves stash aliases, resolved-alias caching, glob aliases, and stash enumeration caches into GlobalRuntimeState. Static map facades remain stable for existing compiler and runtime consumers, while equal-version stash cache entries can no longer leak between runtimes. Phase 8e moves declared scalar/array/hash sets, package-existence caching, generated classloaders, Perl class registration, field inheritance metadata, and package versions into the bound runtime. Reset replaces only that runtime's loader and package services. NameNormalizer bless identity remains deferred to the lifecycle/cloning phase; warning and feature registries remain behind the compilation lock for Phase 10. Phase 9 adds RuntimeCodeRuntimeState for eval IDs, classes, method handles, contexts, anonymous/interpreted code registries, pad constants, method callsites, inline method caches, and runtime-dependent backend flags. Generated fallback bytecode retrieves interpreted code through a runtime-aware facade. Hot subroutine entry and exit paths batch PerlRuntime lookup so the complete six-benchmark matrix remains within budget. Tests cover nested and concurrent bindings, conflicting aliases/stashes, strict declaration isolation, package/class/field/version state, classloader replacement, cache reset ownership, concurrent eval IDs, mixed backend eval closures, and method dispatch. The exact-tree make passes; make test-all is core 83.0% and bundled modules 80.8%. Scalar::Util 1.70, Moo 2.005005, and focused stash/glob/eval tests pass on both backends. One interpreter eval/goto miss was reproduced exactly on merged master. Same-base three-run CPU medians improve by roughly 9% global, 14% lexical, 14% method, 3% closure, 2% regex, and 4% eval-string. Simplify dev/design/concurrency.md progress tracking per maintainer direction: completed history is recovered from commit and PR messages, while the living document retains current status, next steps, and open questions. Phase 10 is next. Generated with [Codex](https://openai.com/codex) Co-Authored-By: Codex <223018245+openai-codex[bot]@users.noreply.github.com>
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
Thread compatibility flags remain disabled.
Phase boundaries
Phase 8d includes stash aliases, resolved-alias caching, glob aliases, and the stash enumeration cache. Runtime stashes themselves already live in the runtime-owned global hash table.
Phase 8e includes declared global sets, package-existence caching, generated classloaders,
ClassRegistry,FieldRegistry, and package-version storage. Warning/feature registries remain compile state for Phase 10.NameNormalizerbless identity remains deferred to the lifecycle/cloning phase.Phase 9 adds
RuntimeCodeRuntimeStatefor eval IDs/classes/method handles/contexts, anonymous and interpreted code, pad constants, method callsites, inline method caches, and runtime-dependent interpreter/disassembly/lexical-alias flags. Generated fallback bytecode uses a runtime-aware interpreted-code facade.Validation
make: passedmake test-all: core 83.0%, bundled modules 80.8%Performance
Three-run CPU-time medians against exact merged base
ff04a83a6:All six gates are within the 5% regression budget.