Skip to content

refactor: extract output bytes extraction into helper function#570

Closed
forkfury wants to merge 1 commit intonexus-xyz:mainfrom
forkfury:refactor/extract-output-bytes-helper
Closed

refactor: extract output bytes extraction into helper function#570
forkfury wants to merge 1 commit intonexus-xyz:mainfrom
forkfury:refactor/extract-output-bytes-helper

Conversation

@forkfury
Copy link

Fix

Removed code duplication in emulate() where exit code and output bytes extraction was repeated three times.

Changes

  • Added extract_output_bytes() helper function
  • Replaced three duplicate blocks with function calls
  • Reduced code by 17 lines

binadamu-isiyoonekana pushed a commit to binadamu-isiyoonekana/nexus-zkvm that referenced this pull request Jan 3, 2026
* draft interface for extensions

* (remove) dummy component

* modify interface to accept lookup elements

* remove config struct

not needed yet, including default components, such as registers
checking

* auto implement methods

* implement enum dispatch

* store claimed sums per component

* Syntax fix in a macro (nexus-xyz#570)

* Fix macro for match, adding commas

* CI fix

* Add BuiltInExtension::generate_preprocessed_trace()

* Adjust proof for dimension of preprocessed trace

* Move initial & final register memory state to a new component (nexus-xyz#572)

* Add FinalReg component placeholder

* Register FinalReg

* Implement FinalReg::generate_preprocessed_trace()

* Implement FinalReg::generate_original_trace()

* Factor away FinalReg::base_columns() for reuse

* Factor away FinalReg::preprocessed_base_columns() for reuse

* Reorder FinalReg::base_columns()

* FinalReg::generate_interaction_trace()

* Integrate FinalReg (wip)

* Cleanup clippy and fmt

* Move initial register state logup to the new component

* Remove unused columns

* Add lookup_elements in FinalRegEval

* Constrain logup in FinalReg component

* Remove Test component

* consistent naming

(main) trace_sizes - preprocessed_trace_sizes, to hint on the same
purpose

* remove default impls

enforce explicit implementation of component

* make final reg component private

it must be enabled by default, enabling it twice would make the
verifier fail

* typos in final_reg.rs

* test claimed sum in register mem check chip

* doc comments

---------

Co-authored-by: Yoichi Hirai <yoichi@nexus.xyz>
@sjudson
Copy link
Contributor

sjudson commented Jan 5, 2026

This is fine as is, I think.

@sjudson sjudson closed this Jan 5, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Jan 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants