Skip to content

Conversation

@Schaeff
Copy link
Collaborator

@Schaeff Schaeff commented Nov 12, 2025

During execution, we match the arenas to Initialized/Uninitialized many times under the hood. Also, we have a lot of methods on OriginalArenas which delegate to Initialized/Unintialized, or panic.

Simplify this by getting an InitializedOriginalArena at the beginning of execution.
During tracegen, use the initialized status to detect if an apc was not called instead of going through number_of_calls().

I don't expect this to make much of a difference performance-wise, but it simplifies the implementation a bit.

original_arenas.ensure_initialized(apc_call_count, &self.air_by_opcode_id, &self.apc);

let arenas = original_arenas.arenas_mut();
let arenas = &mut original_arenas.arenas;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use to match here


// Update the real number of calls to the APC
*original_arenas.number_of_calls_mut() += 1;
original_arenas.number_of_calls += 1;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use to match here

@Schaeff Schaeff marked this pull request as ready for review November 13, 2025 19:40
@leonardoalt
Copy link
Member

Has conflicts

Copy link
Member

@leonardoalt leonardoalt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm as far as I understood it

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.

3 participants