Repository navigation
Conversation
|
Body edit, one line only: the |
Importing bench.candidate_methods builds every port, and a build loads a dataset, so the module's own --help needed a writable cache. These rows run a fresh interpreter with cache_path raising OSError(30), switch off the suite's bundled-sample shortcut so the real path is taken, and pin the whole table so a lazier one cannot silently drop a port.
ALGORITHMS called build(0) for each port only to learn its name, and build loads that port's dataset; the matrix's own --help therefore needed a writable cache and a download on a clean one. Each port now publishes NAME and PROPOSAL_CALLS beside FIDELITY, and the table reads those. build(seed) is unchanged and still the only path that loads data.
|
Read at The 24 pinned rows prove the constants exist, not that they are true. No row in Second gap on the same claim: gsmhard builds are masked. Red reproduces. Base The control is load-bearing, with a host caveat. Remove the stub and give the child a writable
Ports. Each of the fourteen defines Families: this file No blocking finding at this sha: the two test-strength notes above are future-regression coverage, not present behaviour. No UI surface: bench metadata and tests only. Not run: full No merge action from QA: this report is advisory, the merge gate is the repo's review decision on the head sha, and the merge itself is executed by the repo's merge process. |
|
Tip moved to About to edit the body for that, for the two-switch |
|
Body edit: Verification restamped at |
|
Body edit at |
|
Body pre-report: That replaces the row's |
tests/conftest.py sets AGENTDESCENT_GSM8K_SAMPLE and AGENTDESCENT_GSMHARD_SAMPLE, and run() popped only the first. The three GSM-HARD ports (godel_agent, reflexion, sica) therefore loaded their bundled sample, so an import-time build() of one of them passed the test that is supposed to catch it. Pop both. Measured after the change: an import-time reflexion_episodic_memory.build(0) fails 4 and passes 1, and promptbreeder_genetic_prompts.build(0) still fails 4 and passes 1 (the control). Before the change the reflexion mutation read 5 passed. Refs #1260.
|
Body pre-report: |
|
Body pre-report: |
) Closes #1283 ## What changed `source_fingerprint` used to glob `examples/<ALGORITHMS key>/*.py` and, when the key named no directory, add zero paths and raise nothing. A port whose `name` drifted off its folder then stopped changing the fingerprint, so cached results were no longer invalidated by edits to that port. `algorithm_source_dir` now requires each key to be a real directory before the glob, and `source_fingerprint` goes through it. The check is filesystem-only: no dataset load and no `build(0)`. A missing folder fails with `FileNotFoundError` naming the key and the path. A second test pins each `PROPOSAL_CALLS_PER_CANDIDATE` entry to `builder(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.97s - `python -m tools.changelog_fragments check` → 48 changelog fragment(s) OK - `python -m tools.gen_api_docs --check` → docs/api.md is up to date Not 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.
Fixes #1260.
What changed
python -m bench.candidate_methods --helpdescribes a table of fourteen ports, but importing the module built every port just to learn itsnameand its reserved proposal-call count:module.build(0).nameatbench/candidate_methods.py:68(base) andbuilder(0).proposal_calls_per_candidateat:72.build()loads a dataset, so--helpneeded a writable cache —OSError: [Errno 30] Read-only file systemon a read-only~/.cache, and on an empty one a GSM8K download — before it could printusage:.After: each port publishes
NAMEandPROPOSAL_CALLSbeside theFIDELITYit already publishes (examples/godel_agent/godel_agent_self_modify.py:31,examples/voyager/voyager_skill_library.py:45), andbench/candidate_methods.py:67-74reads those constants instead of callingbuild. The port is the only place that knows its own identity, so that metadata belongs with it; a lookup table inbench/would duplicate fourteen names and go stale when the next port lands.build(seed)keeps its signature and stays the only path that loads data.ALGORITHMSis complete immediately after import, and the names, fidelity strings, proposal-call counts, CLI flags and port order are unchanged — the new test pins all fourteen pairs and every count, so a lazily-built table cannot quietly drop a port.Diff: 17 files,
+277/-31— fourteenexamples/*/ports at+7/-2each,bench/candidate_methods.py+6/-3,tests/test_bench_import_cost.py+167/-0,changelog.d/1260-bench-import-cost.md+6/-0.--helpoutput is byte-identical between base and tip: 2640 bytes for the matrix, 450 forcandidate_methods_merge. Both sides were run withAGENTDESCENT_GSM8K_SAMPLE=1andAGENTDESCENT_GSMHARD_SAMPLE=1over an unwritable cache root (AGENTDESCENT_CACHE=/proc), because the base builds every port at import, GSM8K and GSM-HARD alike, before it can print anything: the GSM8K switch gets past the ports that read GSM8K, andreflexion,sicaandgodel_agentneed the GSM-HARD one as well, since theirbuild(0)reachescache_path("gsmhard", …)atexamples/_gsmhard_domain.py:174. The switches are what keep that import off the cache, so every/procrow states them: with no sample switch the base dies on the first port,promptbreeder'sgsm8k_splits, withFileNotFoundError: [Errno 2] No such file or directory: '/proc/gsm8k'(examples/_gsm8k_domain.py:201); withAGENTDESCENT_GSM8K_SAMPLE=1alone it gets past those ports and dies inreflexion'sgsmhard_splitswithFileNotFoundError: [Errno 2] No such file or directory: '/proc/gsmhard'(examples/_gsmhard_domain.py:174); with both it exits 0 and prints 2640 and 450 bytes. The tip needs no switch at all: it prints the same 2640 and 450 bytes, byte-identical to the base-with-both output, and exits 0.Non-goal: no change to
build(), to any dataset path, or to what a run records. No UI surface. No model or network call added.Verification at the tip
Tip SHA: 1ca5fcb
Red at base
0a6e782f8f206eb1477d72f334e84c2ff0ba4b09, clean tree with onlytests/test_bench_import_cost.pyadded, whole file in one run:4 failed, 1 passed in 4.02s. Each failure is the import-time dataset load frombench/candidate_methods.py:68ending inOSError: [Errno 30] Read-only file system; the pass is the control proving the stubbed cache actually raises (errno30).Two mutations prove the test bites on both domains at this tip. An import-time
reflexion_episodic_memory.build(0)inbench/candidate_methods.py(GSM-HARD) now gives4 failed, 1 passed in 3.96s— it read5 passedwhilerun()still inherited the GSM-HARD switch — and an import-timepromptbreeder_genetic_prompts.build(0)(GSM8K) gives4 failed, 1 passed in 3.98s. In both the single pass is theerrno 30control.Ran:
pytest tests/test_bench_import_cost.py -q→ 5 passed in 4.02s at this tippytest tests/test_candidate_methods.py tests/test_candidate_methods_report.py tests/test_textgrad_example.py tests/test_dynamic_cheatsheet.py tests/test_aflow_upstream.py tests/test_promptbreeder_algorithm1.py tests/test_self_refine_upstream.py tests/test_example_entrypoints.py tests/test_results_provenance.py -q→ 333 passedpytest tests/test_bench_main.py tests/test_bench_index.py -q→ 8 passedpython -m tools.changelog_fragments check→ 46 changelog fragment(s) OK (45 at base; this PR adds one)python -m tools.gen_api_docs --check→ docs/api.md is up to datepython -m bench.candidate_methods --helpandpython -m bench.candidate_methods_merge --helpoverAGENTDESCENT_CACHE=/proc: base with both sample switches, tip with no sample switches → rc 0 for all six runs, output byte-identical at 2640 / 450 bytesAGENTDESCENT_CACHE=/proc, no sample switches → rc 1FileNotFoundError: [Errno 2] No such file or directory: '/proc/gsm8k'(first port,promptbreeder), tip rc 0 with the same no-switch environment,usage: candidate_methods.py [-h]AGENTDESCENT_CACHE=/proc,AGENTDESCENT_GSM8K_SAMPLE=1only → rc 1FileNotFoundError: [Errno 2] No such file or directory: '/proc/gsmhard'atreflexion→examples/_gsmhard_domain.py:174grep -rnE "^\s+proposal_calls_per_candidate=[0-9]+,\s*$" examples/ --include=*.py→ no matches; the 14 code arguments are allproposal_calls_per_candidate=PROPOSAL_CALLS,Not run:
pytest -qat this tip — it ran at the pre-rebase tip0547fce(21 failed, 8146 passed, 52 skipped, the 21 all in the four environment-only files:test_sandbox_container.py12,test_era_srbench.py6,test_genesis_example.py2,test_wheel_smoke.py1). The rebase onto0a6e782fbrought main's owntests/,bench/__main__.py, docs and changelog files and touched none of this diff; the families above plus CI'stest (3.9)–test (3.13)cover it.mkdocs build --strict— nodocs/ormkdocs.ymlchange.Risk
Nothing ever checked that a port's
namematched its folder, at this tip or before it:source_fingerprint()(:88-89) globsexamples/<key>/*.py, so a key that names no directory contributes nothing and that port's source drift silently stops changing the fingerprint, while the:540-541guard comparespolicy.nameto a key derived from the same constant and therefore cannot fire. The new pinned table comparesALGORITHMSto a literal list of the fourteen names (tests/test_bench_import_cost.py:105,:121), so it fails on a port that forgetsNAME/PROPOSAL_CALLSand on aNAMEedited alone, but neither list is checked against the filesystem: a renamed folder, or aNAMErenamed together with that list, still leaves:88-89globbing nothing. New here: the dry-run reservation readsPROPOSAL_CALLS(:630,:646) instead ofbuild(0)'s policy, and:540-541does not compareproposal_calls_per_candidate, so a port reserving a different number keeps the suite green and misprints only the dry run. Nothing here callsbuild(), so the pinned table proves published-to-table consistency, not that the constants are whatbuild(0)returns: a mutation that setsname="other"in a port whileNAMEstays put reads5 passedintests/test_bench_import_cost.pyand3 passedinpytest tests/test_candidate_methods.py -k absolute_zero, whose only policy assertion isfidelity, and abuild()that inlined a drifting literal tomorrow would not be caught. The cross-check that the constants are true is a one-time base↔tip dump ofALGORITHMS+PROPOSAL_CALLS_PER_CANDIDATE(0a6e782fvs this tip, fourteen entries each,diffempty), not a suite check; abuild(0)assertion here would reinstate the dataset dependency this card removes.