Proof of concept of column names without touching stark-backend#46
Proof of concept of column names without touching stark-backend#46Schaeff wants to merge 1 commit into
Conversation
| } | ||
| } | ||
|
|
||
| pub trait ColumnNames {} |
There was a problem hiding this comment.
This trait would have the column_name method
|
|
||
| pub trait ColumnNames {} | ||
|
|
||
| impl<T> ColumnNames for T {} |
There was a problem hiding this comment.
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 {} |
There was a problem hiding this comment.
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>>; |
|
|
||
| pub type AirRefWithColumnNames<SC> = Arc<dyn AnyRapWithColumnNames<SC>>; | ||
|
|
||
| impl<SC: StarkGenericConfig, R: AnyRap<SC> + ColumnNames> AnyRapWithColumnNames<SC> for R {} |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
We replace all usages of AnyRap by our extension.
| }; | ||
| ( | ||
| global_airs[*air_id].clone(), | ||
| global_airs[*air_id].clone() as Arc<dyn AnyRap<_>>, |
There was a problem hiding this comment.
When we need to reach into stark-backend, we lower to the original AnyRap
There was a problem hiding this comment.
There are no other compile errors, so I suspect Rust is able to do this lowering automatically in other cases (for example, keygen)
Allows for more fine-grained detection of preflight sponge divergence
Allows for more fine-grained detection of preflight sponge divergence
No description provided.