Skip to content

engine: models with many shared graphical functions fail to compile #582

Closed

Description

@bpowers

When the per-variable compiled pieces of a model were joined, every piece carried its own copy of each graphical function it used, and nothing removed the duplicates.
The bytecode names a graphical function with an 8-bit id, so a model with about 165 distinct tables, each used by many variables, ran past 256 and failed to compile:

graphical function offset 493 exceeds GraphicalFunctionId capacity (u8::MAX = 255)

This blocked C-LEARN.

Status

Fixed on main by #592.
The merger now de-duplicates graphical functions by content, so the count is the number of distinct tables, and still refuses with an error (not a wrapped id) if a model really has more than 256.

Pointers

Activity

  1. added
    bug
    engine
    on May 19, 2026
  2. changed the title [-]engine: GraphicalFunctionId u8 overflow in concatenate_fragments (no cross-fragment GF de-duplication)[/-] [+]engine: models with many shared graphical functions fail to compile[/+] on Oct 12, 2026
  3. bpowers commented on Oct 12, 2026

    @bpowers
    OwnerAuthor

    Closing: already fixed on main.

    FragmentMerger::absorb_gf (src/simlin-engine/src/compiler/symbolic.rs:1890-1945) de-duplicates graphical-function blocks by bit-exact content and errors loudly only when the distinct count exceeds 256. Pinned by the #582 dedup tests in the same file (~3680 onward, including test_concatenate_genuinely_distinct_gf_over_capacity_fails_loud at :4205), and C-LEARN compiles in the default suite (simulates_clearn).

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

    bugengine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions