Skip to content

refactor(interp): split native into engine, policy and feedback - #290

Merged
siyul-park merged 2 commits into
mainfrom
refactor/split-jit
Nov 7, 2026
Merged

siyul-park merged 2 commits into
mainfrom
refactor/split-jit

Conversation

@siyul-park

Copy link
Copy Markdown
Owner

Closes #275.

Change

interp.native held tier decisions, feedback and the native runtime in one type. It is now three, split by which fields each method actually touches:

Type File Owns
feedback interp/feedback.go Profiles and their snapshot
policy interp/policy.go When to compile, promote and retire: thresholds, backoffs, gates, ledgers, failures. HotSpot's CompilationPolicy
engine interp/jit.go Entering native code, serving exits, materializing frames

Dependencies run one way: engine embeds policy, which embeds feedback and *shared. No policy method runs native code.

i.native is now i.jit, and type native is engine. The rule from the design: jit names the subsystem, and native names only machine code and its state. A package-level type jit would collide with the internal/jit import, so the type takes wazero's word.

observe, observer and enter touch sites but install and run native entries, so they stay in engine. shared stays one struct; splitting it would have no second user.

Evidence

  • Behaviour-preserving: method bodies change only their receiver. Two parameters named e became call to free the receiver.
  • make check through the hook, including make check-generated (threaded.go changes only i.native to i.jit).
  • Inlining is at the limit: (*engine).call now costs 80 of 80, up from 78, because the embedded gates adds selector depth. make check-inline still passes and guards it. Any further cost means moving gates up to engine.
  • Benchmark: see this PR's Benchmark Report before merging.

Docs

AGENTS.md task router and docs/jit-internals.md.

🤖 Generated with Claude Code

native held tier decisions, feedback and the native runtime in one type.
engine runs native code, policy decides when to compile and retire, and
feedback holds profiles. i.native becomes i.jit: jit names the subsystem, and
native only machine code and its state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 56 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1f70e331-ca1e-4256-a7ee-0837afa6e7a1
Commits

Reviewing files that changed from the base of the PR and between cb26010 and 615e9f5.

Files selected for processing: 11

  • AGENTS.md
  • Makefile
  • docs/jit-internals.md
  • internal/codegen/call.go
  • interp/feedback.go
  • interp/interp.go
  • interp/jit.go
  • interp/jit_test.go
  • interp/policy.go
  • interp/pool.go
  • interp/threaded.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.06667% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.45%. Comparing base (242b302) to head (615e9f5).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
interp/jit.go 97.89% 1 Missing and 3 partials ⚠️
interp/feedback.go 94.54% 2 Missing and 1 partial ⚠️
interp/policy.go 98.23% 2 Missing ⚠️
interp/pool.go 50.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #290   +/-   ##
=======================================
  Coverage   28.45%   28.45%           
=======================================
  Files         120      122    +2     
  Lines      127432   127432           
=======================================
  Hits        36263    36263           
  Misses      89331    89331           
  Partials     1838     1838           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@siyul-park
siyul-park merged commit 0c10731 into main Nov 7, 2026
7 checks passed
@siyul-park
siyul-park deleted the refactor/split-jit branch November 7, 2026 10:21
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.

refactor(interp): split native into tier policy, profile store, and native runtime

1 participant