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
{{ message }}
Repository navigation
Module visibility dropped to Private during Salsa sync in db.rs #320
In src/simlin-engine/src/db.rs, the Module variant in reconstruct_variable always receives Compat::default() during Salsa sync (around lines 2399-2404 and 2515-2519). This means the Module's visibility field -- now carried inside the Compat struct -- is silently reset to Private during incremental compilation round-trips.
While can_be_module_input is preserved because it is tracked as a separate Salsa field, visibility for Modules has no corresponding tracked field and gets lost.
Pre-existing behavior
This is not a regression. Before PR #319 (which moved compat fields into a Compat struct), visibility was always hardcoded to Private for Modules in reconstruct_variable. The refactor into Compat makes this data loss more visible: the Module now carries a full Compat struct, but its visibility component is silently zeroed out.
Why it matters
Correctness: If Module visibility is ever set to something other than Private (e.g., Public), that information is silently discarded after Salsa round-trips. This could cause incorrect behavior in any future use of Module visibility.
Maintainability: The Compat struct creates an expectation that all its fields are preserved consistently. Having one field silently dropped is a subtle trap for future development.
Add a tracked Salsa field for Module visibility (similar to can_be_module_input) and populate it during sync_variables.
If Module visibility is intentionally always Private, add a code comment explaining why and consider whether the Compat struct should even carry visibility for Modules.
Context
Identified during PR #319 review (move non_negative, can_be_module_input, visibility into Compat struct).
Activity