Skip to content

engine: drop the legacy 0+0 equation from lookup-table detection #608

Closed as not planned

Description

@bpowers

A standalone lookup table (a graphical function with no input expression) is stored with an empty equation.
Projects saved before #606 stored it with the equation 0+0 instead, so lookup-table detection still accepts 0+0 as well as an empty equation.
This issue is about removing that 0+0 case once no saved project needs it.

0+0 has a second, unrelated use that stays: the MDL importer gives it to a variable whose right-hand side is empty, so it evaluates to 0.
The two are told apart by whether the variable has a graphical function.

Why it matters

Cleanup only; the current code is correct.
The cost of keeping it is one comparison and one overloaded constant.

Fix

Removing it safely means first rewriting every saved project that has a lookup table with equation 0+0 to the empty form.
There is no migration tooling for the stored projects today.
Cheaper alternative: normalize 0+0 plus a graphical function to the empty equation when a project is loaded from protobuf, then drop the case from detection.
Or leave it as is.

Pointers

  • src/simlin-engine/src/variable.rs (is_empty_or_sentinel)
  • src/simlin-engine/src/mdl/writer.rs (is_lookup_only_equation)
  • src/simlin-engine/src/mdl/mod.rs (LOOKUP_SENTINEL)

Activity

  1. added
    engine
    on Jun 8, 2026
  2. changed the title [-]engine: remove legacy "0+0" LOOKUP_SENTINEL read-shim from lookup-only detection (gated on datamodel migration)[/-] [+]engine: drop the legacy 0+0 equation from lookup-table detection[/+] on Oct 12, 2026
  3. added
    hygiene
    wontfix
    on Oct 12, 2026
  4. bpowers commented on Oct 12, 2026

    @bpowers
    OwnerAuthor

    Closing as won't fix.

    The shim is one comparison. Removing it needs a migration of stored projects, and no tooling for that exists. A load-time normalization would only move the shim, not remove it.

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

    enginehygienewontfix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions