You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Moving to new Salsa version using query-group repo (DRAFT)
This is a WIP
* Using an updated version of query-group to better support lifetimes.
* Embedded query-group in cairo-lang-proc-macros.
* cairo-lang-proc-macro's derive debug with db now supprots generics better.
* Using salsa::Update on non salsa structs to get the db to work correctly.
* Moved some SmolStr and Arc<str> to use be interned for salsa::Update support.
* Implemented Ord for SmolStrId to have BTreeMap's salsa::Update work.
* Removing upcasting and 'static where applicable
* Adding alot of <'_> for a happy clippy.
* Debug with db now supports lifetimes. Fixed implementations across the codebase.
* Upgraded cairo-lang-debug by:
1. saying Db has the salsa::Database trait
2. making Dummy in test not use shortid
3. Debug with Db can make some trouble but using .long where needed fixes it.
* cairo-lang-utils:
1 .The short_id macro is not really needed so I gutted it and have short_id double interned
1.1. I made short_id have a single long field that is returned by ref.
2. Implemented salsa::Update for OrderedHashMap.
3. Implemented salsa::Update for OrderedHashSet.
4. Added an as_intern_id and from_intern_id using asid and fromid
5. No need for upcast to be static
* cairo-lang-filesystem
1. Removed all interned valued from input.
2. Updated code with lifetimes to better support <'db> interned values.
3. Tests needed updating as set methods are a bit more tricky now with lifetimes.
4. Added utility function for setting input values with using lifetimed objects.
5. Added macro_rules! to set_crate_config and override_file_content so they still accept a short id.
* cairo-lang-syntax:
+ Updated all code to use lifetimes.
+ Updated all code to use the new query-group.
+ Updated codegen.
+ Updated ast.
* cairo-lang-diagnostics:
+ Updated all code to use lifetimes.
+ Updated all code to use the new query-group.
+ Added lifetime to DiagnosticEntry and DiagnosticBuilder as it was necessary by plugin tests.
* cairo-lang-parser:
+ Updated all code to use lifetimes.
+ Updated all code to use the new query-group.
+ Removed the references to empty data structs as they are no longer needed.
+ Using long to turn StrId into a ref for the parser.
* cairo-lang-sierra
+ No need for internkey (as query group will use #[salsa::interned] instead)
* cairo-lang-defs
+ Added lifetime to db
+ Added lifetime to diagnostic_utils
+ Added lifetime to ids
+ Fixing macros in ids to support lifetimes
+ Using self.long(db) instead of lookup_intern to get a ref with a 'db lifetime
+ Change from Arc<[T]> to Arc<Vec<T>> which allows for salsa::Update.
+ Tests to use macro_rules! to get lifetimes right.
+ Updated tests to work with all the changes
+ Fixed debug print formatting.
* cairo-lang-plugins:
+ Updated all code to use lifetimes.
Added preparation for semantic db.
Debug lifetime fixes.
Cycle support for queries
More salsa::Update support.
More lifetimes.
Update for unordered_hash_map and unordered_hash_set.
Deque wrapper and Update for it.
Some rewriter macro support.
Moved priv queries back to salsa db - using update on FunctionBodyData
- Update assumes that ExprId and PatternId are from the FunctionBody in the struct.
AI helped a bit:
Core Upgrade
Migrated to a new Salsa version with better lifetime support by embedding an updated query-group implementation directly into cairo-lang-proc-macros
Added comprehensive lifetime annotations (<'db>, <'_>) throughout the codebase to support the new Salsa architecture
Key Technical Changes
Salsa Integration Improvements:
Implemented salsa::Update trait for non-Salsa structs (OrderedHashMap, OrderedHashSet, Deque wrapper)
Converted SmolStr and Arc<str> to interned values for Salsa compatibility
Added Ord implementation for SmolStrId to support BTreeMap's salsa::Update
Database & Query System:
Removed static lifetime requirements and upcasting where possible
Added cycle support for queries
Improved generic support in proc-macro's derive debug with db
Major Crate Updates:
cairo-lang-proc-macros: Added 11 new test files and embedded query-group functionality
cairo-lang-utils: Gutted short_id macro, added Deque wrapper, intern conversion utilities
cairo-lang-filesystem: Removed interned values from input, added utility functions for lifetime-aware inputs
All syntax/parser/semantic crates: Updated to use explicit lifetimes throughout
New Functionality
Added preparation for semantic database
Improved macro support for lifetimes in test utilities
Changed from Arc<[T]> to Arc<Vec<T>> for salsa::Update compatibility
This is a foundational change that modernizes the entire Cairo compiler's incremental computation infrastructure to better handle borrowed data and lifetimes.
commit-id:9e4ac020
0 commit comments