Skip to content

bench: a port's NAME/PROPOSAL_CALLS are unchecked metadata — a key naming no folder silently drops its sources #1283

Done

Description

@HugoXK

Found in the design read of #1279, which is where this class becomes worth a card: the constants are now the only source of the table, and nothing checks them against the file tree or against the policy a run actually uses.

Not fixed in #1279 on purpose — every direct check calls build(0), which is the dataset load that PR exists to remove. So this is a card for the residue, not a request to reopen it.

Facts at 1ca5fcb2 (bench/candidate_methods.py blob 31aba77348a3240b65994312f05da4ee92aed1c0)

  • :88-89 — source_fingerprint() globs examples/<ALGORITHMS key>/*.py. A key that names no existing directory contributes zero paths and no error, so that port's sources stop being hashed: editing the port no longer changes the fingerprint, and cached results stop being invalidated by it.
  • :540-541 — the runtime guard compares policy.name/policy.fidelity to the table. build now spells both from the same module constants (name=NAME, fidelity=FIDELITY), so the guard cannot fire. At base the key came from build(0).name and the guard compared a second build() call to that key, so the folder relation was unchecked there too — this is not a regression, it is an unchecked invariant that the change makes permanent.
  • Nothing pins key→directory: tests/test_candidate_methods.py only indexes ALGORITHMS by name (:232, :301), tests/test_bench_import_cost.py compares the names to a dump (:101, :116).
  • :630 / :646 — the dry-run reservation is now sum(PROPOSAL_CALLS_PER_CANDIDATE[name] …), read from the constant. :540-541 does not compare proposal_calls_per_candidate, so a port whose build reserves a different number keeps the suite green and misprints only the dry-run text. At base this was impossible by construction: the table was filled from builder(0).proposal_calls_per_candidate.

Falsifiers

  • Rename one port's NAME (and its entry in the pinned table) without renaming its directory, edit that port's source: source_fingerprint() is unchanged, suite green.
  • Set one port's PROPOSAL_CALLS to a number its build does not reserve: --dry-run prints the new number per mode, suite green.

Cheapest fix shape

  • is_dir() on each ALGORITHMS key — filesystem only, no dataset, no build(0). That closes the fingerprint hole and is the check the body of fix(bench): list the candidate methods without building every port #1279 wrongly claimed to have.
  • For the reservation, either compare PROPOSAL_CALLS to the policy in an existing test that already builds every port (tests/test_candidate_methods.py:301), or derive the constant once and delete the second spelling. Design choice, not a mandate.

Acceptance

A mutation that moves a NAME off its folder fails a test without loading a dataset; a mutation that changes one port's PROPOSAL_CALLS fails a test.

Written-by: AgentDescent Lead
Bot: AgentDescent Reviewer (design read of #1279)

Activity

  1. added
    bug
    area:bench
    risk:T1
    on Nov 25, 2026
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

    area:benchbugrisk:T1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions