Skip to content

Conversation

@Schaeff
Copy link

@Schaeff Schaeff commented Oct 31, 2025

No description provided.

}
}

pub trait ColumnNames {}
Copy link
Author

Choose a reason for hiding this comment

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

This trait would have the column_name method


pub trait ColumnNames {}

impl<T> ColumnNames for T {}
Copy link
Author

Choose a reason for hiding this comment

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

Currently we implement it for all types just to prove the approach, but in practice this would be done for each air, as we currently do.


impl<T> ColumnNames for T {}

pub trait AnyRapWithColumnNames<SC: StarkGenericConfig>: AnyRap<SC> + ColumnNames {}
Copy link
Author

Choose a reason for hiding this comment

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

This extends the stark-backend trait with our ColumnNames trait


pub trait AnyRapWithColumnNames<SC: StarkGenericConfig>: AnyRap<SC> + ColumnNames {}

pub type AirRefWithColumnNames<SC> = Arc<dyn AnyRapWithColumnNames<SC>>;
Copy link
Author

Choose a reason for hiding this comment

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

This does the same for AirRef


pub type AirRefWithColumnNames<SC> = Arc<dyn AnyRapWithColumnNames<SC>>;

impl<SC: StarkGenericConfig, R: AnyRap<SC> + ColumnNames> AnyRapWithColumnNames<SC> for R {}
Copy link
Author

Choose a reason for hiding this comment

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

This implementation would stay: if AnyRap and ColumnNames are implemented, then AnyRapWithColumnNames is implemented

}

pub fn add_air<A: AnyRap<SC> + 'static>(&mut self, air: A) {
pub fn add_air<A: AnyRapWithColumnNames<SC> + 'static>(&mut self, air: A) {
Copy link
Author

Choose a reason for hiding this comment

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

We replace all usages of AnyRap by our extension.

};
(
global_airs[*air_id].clone(),
global_airs[*air_id].clone() as Arc<dyn AnyRap<_>>,
Copy link
Author

Choose a reason for hiding this comment

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

When we need to reach into stark-backend, we lower to the original AnyRap

Copy link
Author

@Schaeff Schaeff Oct 31, 2025

Choose a reason for hiding this comment

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

There are no other compile errors, so I suspect Rust is able to do this lowering automatically in other cases (for example, keygen)

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