Skip to content

Simplified bytecode op list#400

Merged
mkeeter merged 1 commit intomainfrom
bytecode-imm
Apr 13, 2026
Merged

Simplified bytecode op list#400
mkeeter merged 1 commit intomainfrom
bytecode-imm

Conversation

@mkeeter
Copy link
Copy Markdown
Owner

@mkeeter mkeeter commented Apr 12, 2026

Remove dedicated immediate ops in favor of a reserved register. This experimentally improves GPU interpreter performance (not yet published).

@mkeeter mkeeter requested a review from Copilot April 12, 2026 17:43
@mkeeter mkeeter force-pushed the bytecode-imm branch 3 times, most recently from 9ecf4e9 to 0eb5b0c Compare April 12, 2026 17:46
Copy link
Copy Markdown

Copilot AI left a comment

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 simplifies the bytecode opcode space by eliminating dedicated immediate op variants and instead encoding immediates via a reserved register (u8::MAX / 0xFF), and removes the now-unneeded RegOpDiscriminants from fidget-core.

Changes:

  • Remove RegOpDiscriminants generation/export from fidget-core.
  • Revamp fidget-bytecode opcode representation to a smaller BytecodeOp set and update bytecode emission to use register 0xFF as the “inline immediate” marker.
  • Update bytecode builder API to error if the reserved register is used, and add new dependencies (serde, thiserror).

Reviewed changes

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

Show a summary per file
File Description
fidget-core/src/compiler/op.rs Drops discriminant-deriving machinery from RegOp now that bytecode no longer relies on it.
fidget-core/src/compiler/mod.rs Stops re-exporting RegOpDiscriminants.
fidget-bytecode/src/lib.rs Introduces a simplified opcode enum and updates bytecode encoding to use reserved-register immediates; Bytecode::new now returns a Result.
fidget-bytecode/Cargo.toml Adds serde + thiserror dependencies needed by the revised bytecode layer.
CHANGELOG.md Documents the reserved-register bytecode revamp and removal of RegOpDiscriminants.
Cargo.lock Locks newly introduced dependencies.

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

Comment thread fidget-bytecode/src/lib.rs
Comment thread fidget-bytecode/src/lib.rs
Comment thread fidget-bytecode/src/lib.rs
Comment thread fidget-bytecode/src/lib.rs
Comment thread CHANGELOG.md
@mkeeter mkeeter merged commit 24c4a6d into main Apr 13, 2026
13 checks passed
@mkeeter mkeeter deleted the bytecode-imm branch April 13, 2026 00:58
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