Skip to content

Admit captured compound property writes to bytecode - #3043

Merged
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-83-captured-compound-logical
Jun 2, 2026
Merged

Admit captured compound property writes to bytecode#3043
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-83-captured-compound-logical

Conversation

@rogeralsing

Copy link
Copy Markdown
Contributor

Summary

  • admit captured dynamic-identifier bases for first-boundary named/computed compound and logical property writes
  • thread admitted dynamic bases/keys/RHS operands through the specialized compiler helpers without widening optional/private/super neighbors
  • add eligibility and public invocation route tests for captured arrow/function-expression compound/logical property writes
  • refresh the unified bytecode expansion contract for the new captured property mutation surface

Proof

  • rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedNameEvaluate_NamedCompoundPropertyWriteWithDynamicIdentifierBase_AcceptsWhenDynamicReadsAreAdmitted|FullyQualifiedNameEvaluate_ComputedCompoundPropertyWriteWithDynamicIdentifierBase_AcceptsWhenDynamicReadsAreAdmitted|FullyQualifiedNameEvaluate_LogicalAndAssignment_DynamicIdentifierBase_AcceptsWhenDynamicReadsAreAdmitted|FullyQualifiedNameEvaluate_LogicalOrAssignment_ComputedDynamicIdentifierBase_AcceptsWhenDynamicReadsAreAdmitted|FullyQualifiedNameArrowFunction_CapturedPropertyCompoundWriteExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameFunctionExpression_CapturedPropertyCompoundWriteExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameArrowFunction_CapturedComputedPropertyCompoundWriteExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameFunctionExpression_CapturedComputedPropertyCompoundWriteExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameArrowFunction_CapturedPropertyLogicalWriteExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameFunctionExpression_CapturedPropertyLogicalWriteExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameArrowFunction_CapturedComputedPropertyLogicalWriteExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameFunctionExpression_CapturedComputedPropertyLogicalWriteExpression_UsesUnifiedBytecodeProductionFastPath" — 12 passed
  • rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests" — 388 passed
  • rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionInvocationTests" — 358 passed
  • rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProduction" — 788 passed
  • rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~ActivationSemanticsProofPackTests" — 48 passed
  • rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedNameExpressionProgramCoverageMapTests&FullyQualifiedNameUnifiedBytecodeExpansionContract_ListsRequiredHeadingsAndCurrentEnums" — 1 passed
  • rtk dotnet build -c Release — 11 projects, 0 errors, existing nullable warnings
  • rtk rg "EvaluateExpression\(|ProfileEvaluateExpression\(" src/Asynkron.JsEngine/Ast/TypedAstEvaluator.ExecutionPlanRunner* — no matches
  • rtk ./tools/profile forloop --memory — Total allocated 6.86 MB
  • rtk git diff --check

Copilot AI review requested due to automatic review settings June 2, 2026 02:01
@rogeralsing
rogeralsing merged commit 4fb2321 into main Jun 2, 2026
@rogeralsing
rogeralsing deleted the codex/unified-bytecode-loop-83-captured-compound-logical branch June 2, 2026 02:01

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 extends the unified-bytecode production pipeline to treat captured dynamic-identifier bases as eligible for first-boundary compound (+=, etc.) and logical (&&=, ||=) property mutations (both named and computed). This fits into the engine’s broader “unified bytecode” effort by widening the set of expression shapes that can be safely VM-owned without falling back to the legacy IR/execution paths.

Changes:

  • Updated unified-bytecode eligibility analysis to accept named/computed compound + logical property writes when the base is a captured dynamic identifier and dynamic reads are admitted.
  • Threaded allowsDynamicIdentifiers through the relevant compiler helpers so base/key/RHS dynamic identifier reads can be compiled without widening optional/private/super-adjacent cases.
  • Added new eligibility and invocation tests covering captured arrow/function-expression compound/logical property writes and refreshed the unified bytecode expansion contract documentation accordingly.

Reviewed changes

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

Show a summary per file
File Description
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionInvocationTests.cs Adds invocation-route proofs that captured compound/logical property writes hit the unified-bytecode fast path for arrow + function expressions.
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs Adds eligibility proofs ensuring dynamic-identifier-base compound/logical property writes are accepted when dynamic reads are admitted.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs Extends candidate detection to permit dynamic-identifier bases and threads the dynamic-admission flag through relevant checks.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs Threads allowsDynamicIdentifiers into property-mutation compilation helpers and emits LoadDynamicIdentifier where appropriate.
docs/unified-bytecode-expansion-contract.md Updates the contract language to include compound/logical property writes in the captured dynamic-base VM-owned surface.

💡 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