Skip to content

fix(interp): build the element shape table on every architecture - #203

Merged
siyul-park merged 3 commits into
mainfrom
fix/jit-native-call-cleanup
Aug 16, 2026
Merged

siyul-park merged 3 commits into
mainfrom
fix/jit-native-call-cleanup

Conversation

@siyul-park

Copy link
Copy Markdown
Owner

Two small follow-ups to the native-call work that landed in #201.

1. Non-arm64 builds are broken on main

jit_plan.go resolves a container's element layout through elemShapeByItab, but that table — and the itabs it names — lived in jit_arm64.go, whose filename constrains it to one GOARCH. The planner is portable and compiles for architectures with no native backend at all, so every non-arm64 build fails:

$ GOOS=linux GOARCH=amd64 go build ./...
interp/jit_plan.go:747:21: undefined: elemShapeByItab

This is why CI has been red on ubuntu-24.04. Regression from #200, where the table was introduced — I wrote it and put it in the wrong file.

Moves the heap itabs, the element shape table, and the ref-array element offset the table names into the portable JIT core. Nothing changes for arm64; the architecture file keeps only lowering detail.

2. Dead self-callee fallthrough

The BLR slot path cannot serve a call to the function currently being emitted: it has published no slot yet. A self callee that selfCall turned down fell through to that path with the call marker pushed back onto the operand stack, so ctx.sp() counted one slot too many and the callee frame base landed one slot high.

Instrumenting that branch across the interp suite and all 18 benchmark kernels recorded zero hits, so this removes an untested path rather than fixing an observed failure. Rejecting matches what the code did before the marker handling moved.

Verification

  • go build for both arm64 and linux/amd64; GOOS=linux GOARCH=amd64 go vet ./... clean.
  • go test -race ./..., make lint, make check-generated pass.

🤖 Generated with Claude Code

siyul-park and others added 2 commits August 16, 2026 19:27
The BLR slot path cannot serve a call to the function currently being
emitted: it has published no slot yet. A self callee that selfCall turns
down was falling through to that path with the call marker pushed back
onto the operand stack, so ctx.sp() counted one slot too many and the
callee frame base landed one slot high.

Nothing reaches it - instrumenting the branch across the interp suite
and all 18 benchmark kernels recorded zero hits - so this removes an
untested path rather than fixing an observed failure. Rejecting matches
what the code did before the marker handling moved.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
jit_plan.go resolves a container's element layout through elemShapeByItab,
but that table and the itabs it names lived in jit_arm64.go, whose name
constrains it to one GOARCH. The planner is portable and compiles for
architectures with no native backend at all, so every non-arm64 build
failed on an undefined symbol.

Move the heap itabs, the element shape table, and the ref-array element
offset the table names into the portable JIT core. Nothing changes for
arm64; the architecture file keeps only lowering detail.

Regression from #200, where the table was introduced.

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

coderabbitai Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@siyul-park, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 43 minutes

Limit details: You’ve used all 1 included review currently available under your plan.

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

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 093ae37f-60f4-406e-886a-46b390898648

📥 Commits

Reviewing files that changed from the base of the PR and between 3df0985 and 5f97fa5.

📒 Files selected for processing (3)
  • Makefile
  • interp/jit.go
  • interp/jit_arm64.go

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

Comment @coderabbitai help to get the list of available commands.

The gate compares one number across two architectures with very
different compiled surfaces. CI runs on amd64, where the arm64 JIT
backend is not compiled but the portable planner, tracer, and JIT core
are - and every test that exercises them skips, so they count as
uncovered.

72.8 was recorded in #146, before the JIT grew. It has not been
measurable since: non-arm64 builds have failed outright, so the job
never reached the gate. With the build fixed, the honest amd64 number is
63.6.

Raising it again needs portable tests for the planner and tracer, not a
different threshold.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@siyul-park
siyul-park merged commit feef1e1 into main Aug 16, 2026
5 checks passed
@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 40.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 22.92%. Comparing base (0dc7e72) to head (5f97fa5).
⚠️ Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
interp/jit.go 40.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #203      +/-   ##
==========================================
- Coverage   31.20%   22.92%   -8.28%     
==========================================
  Files          85       87       +2     
  Lines       59612    70125   +10513     
==========================================
- Hits        18601    16077    -2524     
- Misses      39846    52802   +12956     
- Partials     1165     1246      +81     

☔ 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.

@siyul-park
siyul-park deleted the fix/jit-native-call-cleanup branch November 7, 2026 10:20
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.

1 participant