Skip to content

Remove vstack code from builder and tests#63

Merged
tcrypt25519 merged 6 commits into
mainfrom
claude/remove-vstack-code-3noaq
Feb 14, 2026
Merged

Remove vstack code from builder and tests#63
tcrypt25519 merged 6 commits into
mainfrom
claude/remove-vstack-code-3noaq

Conversation

@tcrypt25519

Copy link
Copy Markdown
Owner

Deletes all vstack infrastructure: the vstack option from Options,
the _vstack field and methods from BuildCtx, the __sync_vstack
helper and all its call sites, and all commented-out vstack branches
in the stack push/pop helpers and push opcode. Also cleans up
use_vstack CLI arguments in jetdbg and the disabled vstack test
variant in rom_tests!.

https://claude.ai/code/session_015PYMujjEHLtp7nkvCHF5PK

Deletes all vstack infrastructure: the `vstack` option from `Options`,
the `_vstack` field and methods from `BuildCtx`, the `__sync_vstack`
helper and all its call sites, and all commented-out vstack branches
in the stack push/pop helpers and `push` opcode. Also cleans up
`use_vstack` CLI arguments in jetdbg and the disabled vstack test
variant in `rom_tests!`.

https://claude.ai/code/session_015PYMujjEHLtp7nkvCHF5PK
Copilot AI review requested due to automatic review settings February 14, 2026 00:04
@semanticdiff-com

semanticdiff-com Bot commented Feb 14, 2026

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  crates/jet/src/builder/ops.rs  20% smaller
  crates/jet/tests/invalid_opcode.rs  15% smaller
  crates/jet/src/builder/env.rs  1% smaller
  crates/jet/tests/roms/mod.rs  1% smaller
  crates/jet/src/builder/contract.rs  1% smaller
  crates/jet/src/bin/jetdbg.rs  0% smaller
  docs/architecture-notes.md Unsupported file format
  docs/architecture.md Unsupported file format
  docs/manifesto.md Unsupported file format

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @tcrypt25519, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on a significant code cleanup by completely removing the vstack (virtual stack) functionality from the project. This includes deleting related configuration options, internal data structures, helper functions, and all associated logic within stack manipulation operations. The change streamlines the codebase by eliminating an unused or experimental feature, simplifying the build context and test configurations, and reducing overall complexity.

Highlights

  • Removal of vstack infrastructure: The vstack option has been removed from the Options struct, along with the _vstack field and its associated methods from BuildCtx.
  • Elimination of __sync_vstack helper: The __sync_vstack helper function and all its call sites have been deleted, signifying the complete removal of its functionality.
  • Cleanup of stack operations: All commented-out vstack branches within the stack push/pop helpers and the push opcode implementation have been removed, simplifying the stack logic.
  • CLI and test environment updates: The use_vstack CLI arguments in jetdbg and the disabled vstack test variant in rom_tests! have been cleaned up, reflecting the removal of the feature from the build and test processes.
Changelog
  • crates/jet/src/bin/jetdbg.rs
    • Removed use_vstack command-line arguments from Cli and BuildArgs structs.
    • Updated the Options::new call to no longer pass a use_vstack parameter.
    • Deleted several blocks of commented-out ROM examples.
  • crates/jet/src/builder/contract.rs
    • Removed unused std::cell::{Ref, RefCell, RefMut} imports.
    • Deleted the VSTACK_INIT_SIZE constant.
    • Removed the _vstack field and its associated _vstack and _vstack_mut methods from the BuildCtx struct.
    • Eliminated the call to ops::__sync_vstack within build_contract_body.
  • crates/jet/src/builder/env.rs
    • Removed the vstack field from the Options struct.
    • Updated the Options::new constructor to no longer accept or initialize the vstack parameter.
    • Deleted the vstack() getter method from the Options struct.
  • crates/jet/src/builder/ops.rs
    • Removed the __sync_vstack function entirely.
    • Deleted all commented-out vstack related conditional logic from __stack_push_int, __stack_pop_1, __stack_pop_2, __stack_pop_3, __stack_pop_7, push, dup, and swap functions.
  • crates/jet/tests/roms/mod.rs
    • Removed the commented-out test_rom_with_vstack_ test macro variant.
    • Updated the _test_rom_body function signature to remove the use_vstack boolean parameter.
    • Modified the Options::new call within _test_rom_body to reflect the removal of the vstack parameter.
    • Deleted commented-out stack assertion logic within TestContractRun::assert_eq.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

The pull request successfully removes the vstack (virtual stack) infrastructure from the jet crate. This includes removing the vstack option from the configuration, removing the _vstack field and associated methods from the build context, and cleaning up all call sites and commented-out code related to the virtual stack. This refactoring simplifies the compiler's internal state and removes dead or disabled code, improving maintainability. The changes are consistent across the modified files and follow the project's structure.

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

Removes the (currently disabled) virtual stack (“vstack”) scaffolding from Jet’s EVM IR builder and associated tests/CLI plumbing, simplifying the build context and stack helpers to always use the runtime stack.

Changes:

  • Removes vstack from builder::env::Options and updates related call sites in the ROM test harness and jetdbg.
  • Deletes BuildCtx vstack storage/accessors and removes vstack sync helper/call sites in the builder.
  • Cleans up commented-out vstack branches in stack push/pop helpers and the ROM test macro.

Reviewed changes

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

Show a summary per file
File Description
crates/jet/tests/roms/mod.rs Drops the vstack test variant and simplifies _test_rom_body to no longer accept/use a vstack flag.
crates/jet/src/builder/ops.rs Removes __sync_vstack and all commented vstack branches; stack helpers now always call runtime stack builtins.
crates/jet/src/builder/env.rs Removes the vstack option/field and updates Options::new signature accordingly.
crates/jet/src/builder/contract.rs Removes vstack storage from BuildCtx and eliminates pre-branch vstack sync.
crates/jet/src/bin/jetdbg.rs Removes the --use-vstack CLI args and updates Options::new invocation.

Comment thread crates/jet/src/builder/env.rs
Comment thread crates/jet/src/builder/env.rs
claude and others added 5 commits February 14, 2026 00:09
Strips the double-underscore convention from all private helpers in
ops.rs (e.g. __stack_pop_2 → stack_pop_2, __call_stack_push_i256 →
call_stack_push_i256) and from the two pub(crate) entry points
(__build_return → build_return, __invalid_jump_return →
invalid_jump_return). Reorders the file so all pub(crate) opcode
implementations appear first, followed by a clearly-marked "Private
helpers" section. Updates the one external call site in contract.rs.

https://claude.ai/code/session_015PYMujjEHLtp7nkvCHF5PK
Options::new takes (mode, emit_llvm, assert); remove the stray `false`
that was inserted before the `assert` argument.

https://claude.ai/code/session_015PYMujjEHLtp7nkvCHF5PK
The vstack infrastructure and Options flag were removed in this PR.
Update architecture.md, architecture-notes.md, and manifesto.md to:
- Drop the BuildCtx _vstack field from struct snippets
- Rename the "Hybrid Stack Model" section to "Real Stack Model" and
  remove the vstack-enabled code example and planned-optimization prose
- Remove __sync_vstack from the control flow pattern snippet
- Update helper function names to match the renamed (no-__ prefix) API
- Remove vstack from Known TODOs, Future Opportunities, Suggested Next
  Steps, Options description, and the Glossary
- Remove the "Virtual Stack Optimization" and "The Virtual Stack"
  caution-zone sections from the manifesto

https://claude.ai/code/session_015PYMujjEHLtp7nkvCHF5PK
@tcrypt25519
tcrypt25519 merged commit b2e17e5 into main Feb 14, 2026
1 check passed
@tcrypt25519 tcrypt25519 linked an issue Feb 14, 2026 that may be closed by this pull request
tcrypt25519 added a commit that referenced this pull request Feb 16, 2026
* Remove vstack code from builder and tests

Deletes all vstack infrastructure: the `vstack` option from `Options`,
the `_vstack` field and methods from `BuildCtx`, the `__sync_vstack`
helper and all its call sites, and all commented-out vstack branches
in the stack push/pop helpers and `push` opcode. Also cleans up
`use_vstack` CLI arguments in jetdbg and the disabled vstack test
variant in `rom_tests!`.

https://claude.ai/code/session_015PYMujjEHLtp7nkvCHF5PK

* Remove __ prefix from private identifiers and move them below public fns

Strips the double-underscore convention from all private helpers in
ops.rs (e.g. __stack_pop_2 → stack_pop_2, __call_stack_push_i256 →
call_stack_push_i256) and from the two pub(crate) entry points
(__build_return → build_return, __invalid_jump_return →
invalid_jump_return). Reorders the file so all pub(crate) opcode
implementations appear first, followed by a clearly-marked "Private
helpers" section. Updates the one external call site in contract.rs.

https://claude.ai/code/session_015PYMujjEHLtp7nkvCHF5PK

* chore: CI change 🤖

* Fix extra argument in invalid_opcode test

Options::new takes (mode, emit_llvm, assert); remove the stray `false`
that was inserted before the `assert` argument.

https://claude.ai/code/session_015PYMujjEHLtp7nkvCHF5PK

* Remove unused invalid_jump_return function

Dead code with no call sites; flagged by clippy -D warnings.

https://claude.ai/code/session_015PYMujjEHLtp7nkvCHF5PK

* Remove vstack references from docs

The vstack infrastructure and Options flag were removed in this PR.
Update architecture.md, architecture-notes.md, and manifesto.md to:
- Drop the BuildCtx _vstack field from struct snippets
- Rename the "Hybrid Stack Model" section to "Real Stack Model" and
  remove the vstack-enabled code example and planned-optimization prose
- Remove __sync_vstack from the control flow pattern snippet
- Update helper function names to match the renamed (no-__ prefix) API
- Remove vstack from Known TODOs, Future Opportunities, Suggested Next
  Steps, Options description, and the Glossary
- Remove the "Virtual Stack Optimization" and "The Virtual Stack"
  caution-zone sections from the manifesto

https://claude.ai/code/session_015PYMujjEHLtp7nkvCHF5PK

---------

Co-authored-by: Claude <noreply@anthropic.com>
@tcrypt25519
tcrypt25519 deleted the claude/remove-vstack-code-3noaq branch February 16, 2026 20:02
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.

Remove currently-unused vstack code

3 participants