Skip to content

bugc: example program-validity test cost grows with instructions times locals #396

Open

Description

@gnidan

The "Program validity" test in packages/bugc/test/examples/examples.test.ts validates every distinct instruction context with Hyperjump. Because bugc lists a function's locals at every instruction, consecutive instructions get mostly distinct, large contexts, so the context cache rarely hits and the cost grows with instructions times locals in scope. advanced/token-registry.bug took 17.4s at O0 on CI (4.7s at O1), which is why #395 raised the per-test timeout from 10s to 30s. The next larger example will cross that bound too.

Options, cheapest first: validate smaller units (each distinct variable entry or pointer inside a context) so they share across instructions; validate only contexts that differ from the previous instruction's; or validate the full context set at one level and the context-free skeleton at the others. Worth timing per example first to confirm the cost is validation and not compilation.

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