Repository navigation
template: FC_SKIP_PYTEST and FC_SKIP_SNAPSHOT for timing-only replay trials - #55
Merged
ArjunS07 merged 2 commits intoOct 8, 2026
Merged
Conversation
ArjunS07
merged commit Oct 8, 2026
1e2909a
into
survey/phase1-template-20261008
0 of 3 checks passed
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.
Purpose
Timing-only replay trials ("retime", no agent) only need the timing pass. This PR lets the trial environment turn off pytest and the snapshot check with
FC_SKIP_PYTEST=1andFC_SKIP_SNAPSHOT=1. Attempts and measure jobs never set these variables, so their behaviour does not change.How it works
flowchart LR M[LSV measure] --> S{FC_SKIP_SNAPSHOT=1?} S -- yes --> SM[write snapshot_skipped.json] S -- no --> SV[snapshot baseline / download / verify] SM --> P{FC_SKIP_PYTEST=1?} SV --> P P -- yes --> PM[write skip marker to test_results.json] P -- no --> PR[pytest_runner.py] PM --> R[parser.py: reward.json] PR --> ROnly the exact value
1turns a step off. An unset variable or any other value (0,true, empty) runs every step as before.A skipped step is recorded as not run. It is never recorded as a pass:
tests_passednulltests_ran(new)falsepytest_skipped(new)"FC_SKIP_PYTEST"snapshots_passednullsnapshot_verify_ranfalsesnapshot_skipped(new)"FC_SKIP_SNAPSHOT"When nothing is skipped,
tests_ranistrueiftest_results.jsonexists, andpytest_skippedandsnapshot_skippedarenull.Changes
test.sh: withFC_SKIP_SNAPSHOT=1, the oracle snapshot baseline, the snapshot download andsnapshot-tool verifydo not run. The script writessnapshot_skipped.jsonand logs one line.Effect: no snapshot work and no snapshot result in a replay trial.
Before: the snapshot steps always ran when their inputs were present.
test.sh: withFC_SKIP_PYTEST=1,pytest_runner.pydoes not run. The script writes{"pytest_skipped": "FC_SKIP_PYTEST", "tests_ran": false, "tests_passed": null}totest_results.jsonand logs one line. This also replaces the "Tests skipped as per configuration" passing result of tasks rendered without pytest.Effect: no pytest work in a replay trial, and no fake pass.
Before: pytest always ran (or the configured passing result was written).
test.sh: when both flags are set, the trial does not take the measure gate slot for the tests step.Effect: a replay trial does not wait for a slot it does not use.
Before: the slot was always taken.
parser.py: reads the two skip markers. A skipped pytest givestests_passed=null, an emptypytestblock and the new top-leveltests_ranandpytest_skippedfields. A skipped snapshot check givessnapshots_passed=nullandsnapshot_verify_ran=falseeven if a summary file is present, plus the newsnapshot_skippedfield.reward.txtstill gives the failure penalty whentests_passedis nottrue.Effect: a skip cannot read as a pass.
Before: these fields did not exist.
test.sh: the two flags are read on the first lines, before any file is sourced, into readonly variables_fc_skip_pytestand_fc_skip_snapshot. ThenFC_SKIP_PYTESTandFC_SKIP_SNAPSHOTare unset. All later checks use only the readonly variables.Effect: a file under
/etc/profile.dcannot turn a skip on or off, byexport, by plain assignment or bydeclare -g.Before: (first commit of this PR) the flags were read after sourcing, so the agent could add
export FC_SKIP_PYTEST=1to a sourced file and skip pytest.tests/docker/test_template_skip_flags.py(new) andtest_template_pytest_step.py(block extraction updated for the newif).Verification
PYTHONPATH=src .venv/bin/python -m pytest tests/docker: 448 passed, 10 skipped.export, by assignment and bydeclare -g) does not skip any step. A file that sets them to0or unsets them does not undo an incoming skip. Both tests fail when thereadonlyandunsetlines are removed.run_pytestvalues; unset, empty,0andtruerun every step in the same order; each flag skips only its own step; both flags take no gate slot; the parser output for each skip and for no skip.parser.pyrun on Python 3.8 (uv run --no-project --python 3.8) with both skip markers givestests_passed=None, tests_ran=False, pytest_skipped='FC_SKIP_PYTEST', snapshots_passed=None, snapshot_verify_ran=False, snapshot_skipped='FC_SKIP_SNAPSHOT'.Notes
FC_SKIP_SNAPSHOT=1also skips the oracle snapshot baseline recording, because it is part of the same snapshot step.reward.json. Existing field names and values do not change./etc/profile.d/asv_utils.shand/etc/profile.d/asv_build_vars.shafter the agent phase, and the agent (root) can write to them. This PR protects only the two skip flags. The other values that test.sh and its scripts read after sourcing need a separate review:ENV_NAME,BENCHMARK_DIR,FC_PYTEST_TIMEOUT,FORMULACODE_SNAPSHOT_FILTER,FORMULACODE_SNAPSHOT_TIMEOUT,FORMULACODE_SNAPSHOT_WORKERS,FORMULACODE_NO_UPLOAD,LSV_OUTPUT_DIR,MEASURE_GATE_URL,MEASURE_GATE_CONNECT_TIMEOUT,MEASURE_GATE_ACQUIRE_WAIT,SUPABASE_URL,SUPABASE_ANON_KEY.BENCHMARK_DATA,LSV_OUTPUT_DIR,FC_REBUILD_CMD(set by test.sh after sourcing).PYTHONPYCACHEPREFIX,T_BENCH_TASK_LOGS_PATH,T_BENCH_CONTAINER_LOGS_PATH.DATASMITH_VERIFY_CONSTANT_FACTOR_MIN,DATASMITH_VERIFY_CONSTANT_FACTOR_MAX,DATASMITH_VERIFY_DILUTION_RATIO_MAX,DATASMITH_VERIFY_MEASURE_GEOMEAN_MIN,FORMULACODE_BASELINE_FROM_CACHE,FORMULACODE_EXPECTED_N,T_BENCH_TASK_LOGS_PATH,SUPABASE_URL,SUPABASE_ANON_KEY.SUPABASE_SERVICE_KEYas well.CFLAGS,CPPFLAGS,CONDA_PREFIX,NP_INC,PYTHONPATH,TILEDB_PATH.PATHandPYTHONPATH, or define shell functions such aspython,timeout,snapshot-toolormg_acquire, which test.sh then calls.