Skip to content

Admit captured arrow reads to production bytecode - #3038

Merged
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-78-arrow-closure
Jun 2, 2026
Merged

Admit captured arrow reads to production bytecode#3038
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-78-arrow-closure

Conversation

@rogeralsing

Copy link
Copy Markdown
Contributor

Summary

  • admit simple arrow functions with read-only ordinary environment identifier reads to production unified bytecode
  • allow admitted dynamic-identifier bases in named property-read chains
  • update the unified bytecode expansion contract and proof-pack inventory

Verification

  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_NamedPropertyReadWithDynamicIdentifierBase_AcceptsWhenDynamicReadsAreAdmitted|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ArrowFunction_CapturedOuterEnvironmentRead_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ArrowFunction_LexicalThis_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ArrowFunction_LexicalNewTarget_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedName~UnifiedBytecodeProductionInvocationTests.SimpleArrowFunction_UsesUnifiedBytecodeProductionFastPath'
  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests'
  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedName~UnifiedBytecodeProductionInvocationTests'
  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedName~UnifiedBytecodeProduction'
  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedName~ActivationSemanticsProofPackTests'
  • rtk dotnet build Asynkron.JsEngine.sln -c Release
  • rtk rg "EvaluateExpression(|ProfileEvaluateExpression(" src/Asynkron.JsEngine/Ast/TypedAstEvaluator.ExecutionPlanRunner*
  • rtk ./tools/profile forloop --memory (6.85 MB)
  • rtk git diff --check

Copilot AI review requested due to automatic review settings June 2, 2026 01:02
@rogeralsing
rogeralsing merged commit 94f8a1a into main Jun 2, 2026
@rogeralsing
rogeralsing deleted the codex/unified-bytecode-loop-78-arrow-closure branch June 2, 2026 01:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR widens “production unified bytecode” routing to admit additional safe arrow-function and property-read shapes that rely on read-only dynamic identifier lookups (ordinary environment reads), and updates the proof-pack/contract documentation and tests accordingly.

Changes:

  • Allow first-boundary named property-read chains whose base is an admitted dynamic identifier read (when ordinary dynamic reads are enabled).
  • Extend arrow-function production fast-path gating to allow read-only ordinary environment identifier reads (and related named property reads) as VM-owned dependencies.
  • Update and add tests + contract text to reflect the expanded eligibility surface.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionInvocationTests.cs Updates arrow invocation test to assert the production unified bytecode fast-path for captured outer environment reads.
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs Adds eligibility coverage for named property reads with a dynamic-identifier base when dynamic reads are admitted.
tests/Asynkron.JsEngine.Tests/ExpressionProgramCoverageMapTests.cs Adjusts proof-pack inventory linkage to reference an appropriate “no unified route” control test after arrow admission changes.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs Expands first-boundary named property-read candidate detection to include admitted dynamic identifier base reads; updates decline reasoning text.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs Compiles first-boundary named property-read chains using a loader that can emit LoadDynamicIdentifier for admitted dynamic bases.
src/Asynkron.JsEngine/Ast/TypedAstEvaluator.SyncFunctionInvoker.cs Broadens arrow fast-path gating and activation descriptor flags so admitted arrow shapes can opt into ordinary dynamic identifier environment operations.
docs/unified-bytecode-expansion-contract.md Updates the expansion contract ledger and arrow pre-gate narrative to reflect the widened admitted dependency set.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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