Skip to content

engine: validating a patch recompiles the whole model #292

Closed

Description

@bpowers

Validating a patch compiled the patched project in a brand-new salsa database, so editing one equation recompiled every variable in the model.
Validation should reuse the project's long-lived database so unchanged variables come from cache, and roll the database back if the patch is rejected.

Why it matters

Every editor edit runs this validation, so on a large model each keystroke paid for a full compile.

Current state

apply_project_patch_internal in src/libsimlin/src/patch.rs now stages the patch into the project's own database with SimlinDb::sync_staged and undoes it with SimlinDb::restore on failure (src/simlin-engine/src/db.rs).
The old entry point that built a throwaway database (Project::from_with_model_cb in project.rs) was deleted in #375.

Pointers

Activity

  1. added
    engine
    on Jun 8, 2026
  2. added
    enhancement
    on Oct 12, 2026
  3. changed the title [-]Thread persistent salsa DB through Project compilation for incremental patch validation[/-] [+]engine: validating a patch recompiles the whole model[/+] on Oct 12, 2026
  4. bpowers commented on Oct 12, 2026

    @bpowers
    OwnerAuthor

    Closing: already fixed on main.

    apply_project_patch_internal stages the patched datamodel into the project's own persistent db with db.sync_staged (src/libsimlin/src/patch.rs:460), validates there, and rolls back a rejected or dry-run patch with db.restore (patch.rs:543); Project::from_with_model_cb and src/simlin-engine/src/project.rs no longer exist (#375). Pinned by src/libsimlin/tests/integration/incremental.rs (dry-run and rejected-patch staging tests) and tests/integration/wasm/incremental.rs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    engineenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions