Skip to content

feat(variables): Introduce new schema - #2065

Open
szokeasaurusrex wants to merge 5 commits into
szokeasaurusrex/fix-variable-type-depthfrom
szokeasaurusrex/variables-extraction-schema
Open

szokeasaurusrex wants to merge 5 commits into
szokeasaurusrex/fix-variable-type-depthfrom
szokeasaurusrex/variables-extraction-schema

Conversation

@szokeasaurusrex

Copy link
Copy Markdown
Member

Introduce a new schema for sending extracted variables. The new schema is compatible with the old one, but provides ways to send more data about variables, including type and kind information.

In the future, we can expand the schema to allow multiple representations for variables, e.g. some values may be represented as both arrays and pointers.

@szokeasaurusrex
szokeasaurusrex force-pushed the szokeasaurusrex/variables-extraction-schema branch from 9156448 to 4c9a5cd Compare September 24, 2026 15:27
Comment thread crates/symbolicator-native/src/interface/variables.rs Outdated
Comment thread crates/symbolicator-native/src/interface/variables.rs Outdated
@szokeasaurusrex
szokeasaurusrex added this pull request to stack #2079 October 2, 2026 12:50
@szokeasaurusrex
szokeasaurusrex removed this pull request from stack #2079 October 8, 2026 09:03
@szokeasaurusrex
szokeasaurusrex force-pushed the szokeasaurusrex/variables-extraction-schema branch from 9049059 to c072ec3 Compare October 8, 2026 09:03
@szokeasaurusrex
szokeasaurusrex added this pull request to stack #2087 October 8, 2026 09:03
@szokeasaurusrex
szokeasaurusrex marked this pull request as ready for review October 8, 2026 11:25
@szokeasaurusrex
szokeasaurusrex requested a review from a team as a code owner October 8, 2026 11:25
Comment thread crates/symbolicli/src/event.rs Outdated

@cursor cursor 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.

Stale Bugbot comment from a previous run.

Comment thread crates/symbolicli/src/event.rs Outdated
Comment thread crates/symbolicator-native/src/interface/variables.rs
@szokeasaurusrex
szokeasaurusrex marked this pull request as draft October 13, 2026 12:56
@szokeasaurusrex
szokeasaurusrex marked this pull request as ready for review October 13, 2026 13:05
@szokeasaurusrex
szokeasaurusrex force-pushed the szokeasaurusrex/variables-extraction-schema branch from ae88d0a to 893355f Compare October 13, 2026 14:23

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 893355f. Configure here.

/// Variables keyed by their names.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(transparent)]
pub struct Variables(HashMap<String, Variable>);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Variable map serializes in random order

Low Severity

Variables stores entries in a HashMap, so serialized vars keys come out in non-deterministic order. Other serialized maps in this crate, such as Registers, use BTreeMap for stable output.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 893355f. Configure here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should keep the BTreeMap here, that's generally what we do on the protocol level to have deterministic serialization

Introduce a new schema for sending extracted variables. The new schema is compatible with the old one, but provides ways to send more data about variables, including type and kind information.

In the future, we can expand the schema to allow multiple representations for variables, e.g. some values may be represented as both arrays and pointers.
@szokeasaurusrex
szokeasaurusrex force-pushed the szokeasaurusrex/variables-extraction-schema branch from 893355f to 796510c Compare October 13, 2026 15:15
@szokeasaurusrex
szokeasaurusrex removed this pull request from stack #2087 October 13, 2026 15:17
@szokeasaurusrex
szokeasaurusrex changed the base branch from master to szokeasaurusrex/fix-variable-type-depth October 13, 2026 15:19
@szokeasaurusrex
szokeasaurusrex added this pull request to stack #2096 October 13, 2026 15:19
/// Variables keyed by their names.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(transparent)]
pub struct Variables(HashMap<String, Variable>);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should keep the BTreeMap here, that's generally what we do on the protocol level to have deterministic serialization

pub struct Variables(HashMap<String, Variable>);

impl Variables {
pub fn is_empty(&self) -> bool {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think depending on usage we could also impl Deref

///
/// Constructed via [`Value::ty`].
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) struct TypedValue {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
pub(crate) struct TypedValue {
pub struct TypedValue {

The module is already private so I wouldn't worry too much about visibility here. Generally we try to avoid pub(<specifier>)

Comment thread crates/symbolicator-native/src/interface/variables.rs
///
/// Constructed via [`Value::ty`].
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) struct TypedValue {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we can inline TypedValue into Variable now.

This branch has not been deployed

No deployments
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