Skip to content

(OPT) Compare canonical function-instance identities without temporary encoded buffers #853

Open

Description

@wsdt

Source-bound at 17b12c909916ce8671b43f208b59f3432144709a: src/hir/validation.rs:1264–1268 derives an owned FunctionInstanceId only to compare it with a retained identity. src/hir/ids.rs:578–592 builds both an encoded-argument CappedString and a final formatted owned ID. The same comparison pattern occurs in src/hir/validation/generic_template.rs:204,501,576,593. Existing ids.rs:600–638 has a borrowed exact-encoder precedent. Main b80 does not already change these files.

Implement an exact streaming canonical-ID comparison for these validation-only sites, preserving the complete allocating derive constructor as an independent oracle and construction API. Initially retain every argument.identity_key() producer; claim removal only of the actual encoded-argument buffer and final temporary ID. Fund genuinely new controls before their formation, or eliminate the extra carriers lexically. No cap, forecast, refund, guessed fee or diagnostic-order change.

Preserve exact grammar, UTF-8 and byte-length handling, argument ordering, forged/truncated/prefix IDs, duplicate insertion before canonical-identity refusal, fresh/sticky/floor failures and complete Drop. Exercise the existing harness with minimal direct success/negative and independent old/new controls after the implementation batch; scoped Clippy and actual moved pins only when needed. No full suite.

Historical 47f Catalog23 and original Shift schedule fail in HIR final validation at their unchanged 64 MiB ceiling. Their stage-only receipts do not establish that this operation selected the refusal, and no numerical saving or application fit is promised. Keep those original owners unchanged and use their later actual outcomes to judge fit. Work is being implemented in an isolated next-batch lane; no new runtime or agent-token measurement is claimed.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions