Skip to content

Incremental path: @N position syntax and MEAN with dynamic ranges unsupported #377

@bpowers

Description

@bpowers

Summary

Three array features are not yet supported on the salsa incremental compilation path and fall back to the monolithic path. The affected tests explicitly use assert_compiles() instead of assert_compiles_incremental() with comments documenting the limitation.

Affected features

1. @n position syntax (subscript element selection by position)

@N syntax allows selecting array elements by dimension position (e.g., arr[@1] for the first element, matrix[@2, @1] for dimension reordering). Two tests retain the monolithic path for this reason:

  • dimension_position_single (line 341): arr[@1] -- scalar selection by position
  • dimension_position_and_wildcard (line 1359): cube[@1, *, @3] -- combining position syntax with wildcards

Note: the dimension_position_reorder test (line 366) using matrix[@2, @1] does use assert_compiles_incremental(), so some @N cases may already work on the incremental path.

2. MEAN with dynamic ranges

MEAN(data[start_idx:end_idx]) where the range bounds are variable references rather than literal constants. One test retains the monolithic path:

  • mean_with_dynamic_range (line 2022): MEAN(data[start_idx:end_idx]) with start_idx and end_idx as scalar constants

Why it matters

These tests silently fall back to the monolithic compilation path, which means they do not exercise the incremental pipeline. As monolithic-path code is eventually removed (per the salsa migration plan), these features will need incremental support or will regress.

Component(s) affected

  • simlin-engine: src/simlin-engine/src/db.rs (incremental compilation pipeline)
  • simlin-engine: src/simlin-engine/src/array_tests.rs (test assertions)

Possible approaches

  • Investigate what specifically fails when switching these tests to assert_compiles_incremental() -- the error messages will indicate which incremental tracked function is missing the relevant array lowering logic.
  • The @N syntax likely needs handling in the dimension resolution or subscript expansion phases of the incremental path.
  • Dynamic ranges for MEAN likely need the range size computation to be available during incremental compilation.

Context

Identified during review of the finish-salsa-migration branch. Related to but distinct from #295 (which covers module expansion, builtin expansion, and variable layout gaps).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions