Skip to content

Admit binary template substitutions in call args - #3011

Merged
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-51-template-binary-substitution
Jun 1, 2026
Merged

Admit binary template substitutions in call args#3011
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-51-template-binary-substitution

Conversation

@rogeralsing

Copy link
Copy Markdown
Contributor

Summary

  • admit simple binary substitutions inside untagged template literal call arguments for production unified bytecode routing
  • add an eligibility proof and runtime route-hit proof for the logExpr template-literal call shape
  • update the decline contract CallDependency row to point at a remaining call-dependency decline

Verification

  • focused route proof: 5 tests passed
  • broad bytecode proof: 888 tests passed
  • docs/decline proof: 4 tests passed
  • engine build: 2 projects, 0 errors, 0 warnings
  • AST seam scan: no EvaluateExpression/ProfileEvaluateExpression hits in execution-plan runner files
  • git diff --check: clean

Copilot AI review requested due to automatic review settings June 1, 2026 21:04
@rogeralsing
rogeralsing merged commit ab2b1f2 into main Jun 1, 2026

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 unified-bytecode production routing to admit a specific previously-declined call-argument shape: untagged template literals whose substitution is a simple binary expression (e.g. `result: ${a + b}`). This fits into the existing “simple template literal span” machinery used by the production eligibility checker and unified-bytecode compiler.

Changes:

  • Add coverage proving the unified-bytecode production fast-path is hit for a template literal containing a binary substitution.
  • Update production eligibility scanning to recognize the op-sequence for a simple binary substitution inside a template literal span.
  • Update the unified-bytecode compiler to emit unified bytecode for that binary-substitution template span and adjust the decline-contract doc row accordingly.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionInvocationTests.cs Adds a runtime/route-hit test proving the fast-path is used for ${a + b} inside an untagged template literal call argument.
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs Updates eligibility expectations for the ${a + b} template substitution shape (now accepted) and adds instruction-level assertions.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs Extends “simple template literal span” measurement to include a recognized 5-op binary-substitution sequence.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs Extends template literal span compilation to emit unified bytecode for binary substitutions; introduces a helper for pre-checking operand-load eligibility.
docs/unified-bytecode-expansion-contract.md Updates the CallDependency row text and proof command to reflect the newly admitted template-literal substitution shape.

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

Comment on lines +8837 to +8850
TryAppendSimpleOperandLoad(
op,
expressionProgram,
activationSlots,
unified,
literalConstants,
out _);
TryAppendSimpleOperandLoad(
rightOperand,
expressionProgram,
activationSlots,
unified,
literalConstants,
out _);
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