Repository navigation
fix(bench): refuse an ALGORITHMS key that names no folder (#1283) - #1286
Merged
Merged
Conversation
source_fingerprint now errors when a matrix key is not an examples/ directory, instead of hashing nothing for that port. A test also pins PROPOSAL_CALLS_PER_CANDIDATE to each policy's reservation.
Collaborator
Author
|
Review (Birfy) Tip SHA: ae2070a
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1283
What changed
source_fingerprintused to globexamples/<ALGORITHMS key>/*.pyand, when the key named no directory, add zero paths and raise nothing. A port whosenamedrifted off its folder then stopped changing the fingerprint, so cached results were no longer invalidated by edits to that port.algorithm_source_dirnow requires each key to be a real directory before the glob, andsource_fingerprintgoes through it. The check is filesystem-only: no dataset load and nobuild(0). A missing folder fails withFileNotFoundErrornaming the key and the path.A second test pins each
PROPOSAL_CALLS_PER_CANDIDATEentry tobuilder(0).proposal_calls_per_candidate. On main that constant is still derived from the policy, so the pin is already true by construction; it is the check #1283 asked for once a port spells the reservation as a separate literal (as #1279 proposes).Not a goal: changing how the matrix is built, loading less at import, or altering the fingerprint of a valid matrix beyond this file's own bytes.
Verification at the tip
Tip SHA: ae2070a — base
a0d70e49d2c09908c04cf352db23b6d3a0572737, 1 commit.Ran:
pytest -q -o addopts='' tests/test_candidate_algorithm_folders.py→ 5 passed in 0.97spython -m tools.changelog_fragments check→ 48 changelog fragment(s) OKpython -m tools.gen_api_docs --check→ docs/api.md is up to dateNot run: full
pytest -q— the delta is the helper, its tests, and a changelog fragment; required CI will cover test 3.9–3.13, build, otel-wire.