Skip to content

Make QuantitySignature construction independent of caller ordering #1946

Open

Description

@shunichironomura

Warning

This content was written by an AI agent and must be verified by a human developer. After human verification, this alert may be removed.

Summary

QuantitySignature is only correct if callers call check_quantity_param for every parameter in order on both the built-in and extern paths. This relies on the caller following a protocol, against the project rule that invariants are enforced by the API.

Current state

  • FunctionSignature::try_new already guarantees each dimension variable is bound before use.
  • The remaining internal-error site is in tir/dim_check/builtins.rs (the QuantitySignature walk shared with plugin extern signatures).

Proposed direction

Re-encode monomials over binder slots when FunctionSignature is validated, so a QuantitySignature can only be constructed through one validated walk, and the per-parameter call order no longer matters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions