Skip to content

refactor(parsec): move the parsec scripts under examples/, merging the shared pieces - #800

Merged
bcarmeli merged 3 commits into
mainfrom
parsec/move-to-examples
Oct 12, 2026
Merged

bcarmeli merged 3 commits into
mainfrom
parsec/move-to-examples

Conversation

@bcarmeli

Copy link
Copy Markdown
Collaborator

scripts/parsec/ → examples/parsec/, per Osher's note that this is where benchmarks belong. All moves are git mv, so history follows.

The shared pieces come up to the example root

examples/parsec/
  README.md
  adapters/adapter.py        ← v4_t2_e1/common/adapters/
  optimizer/INSTRUCTIONS.md  ← v4_t2_e1/common/optimizer/
  parsec_paths.py            ← v4_t2_e1/common/
  v4_t2_e1/   scaffold_projects, run_one_task, preflight_check
  h4/         scaffold_eval_projects, run_one_eval.sh, make_lane.sh, fan_out.sh, collect.py, audit/
  tests/      5 modules

This matches examples/<name>/{adapters,optimizer}/ as in skillsbench, and drops an indirection that was misleading: the adapter and optimizer were already shared rather than copied — both arms symlink the same files into every generated project. Keeping them nested inside one arm's directory misrepresented that. h4's constant was literally named V4T2_DIR while pointing at files it co-owns; it's now EXAMPLE_DIR.

Path fixes

what change
adapter.py _REPO_ROOT parents[5] → parents[3] (two levels shallower)
adapter.py _COMMON_DIR unchanged at parents[1] — resolved to common/, now resolves to the example root, which is where parsec_paths.py went
arm drivers' REPO_ROOT unchanged at parents[3] — scripts/parsec/<arm>/ and examples/parsec/<arm>/ are the same depth
tests/ moved up a level: parents[1]/"common"/"adapters" → parents[1]/"adapters", parents[4]/"core" → parents[3]/"core", drivers reached via parents[1]/"v4_t2_e1"
both scaffolds' COMMON_*_SRC resolve from the example root, not a common/ child

Also updated outside the moved tree, all of which named the old path: RUN_H4.md, docs/how-to/ccc/CCC_PODMAN_SETUP.md, scripts/ccc/parsec_stack.sh, .gitignore. Repo-wide grep for scripts/parsec is now empty.

README.md rather than PROMPT.md

The three PROMPT.md files are paste-to-your-agent intake prompts for onboarding a new benchmark. Parsec was onboarded months ago by a different route, so writing one would describe a flow that never happened. This is a short README in the shape of toy_calc's and toy_skill's: layout, the two env vars and why neither has a default, that bundles and results live on parsec-history, and a pointer to the three trial-integrity detectors.

Tests

71 passed, 0 failed — green for the first time.

The second commit fixes two tests that have failed on main since TASK_ID support was removed from the adapter (flagged in #694, unrelated to this move). It's separate so it can be dropped on its own.

  • test_raises_clearly_when_task_id_unset asserted "TASK_ID" appears in the construction error; the adapter now raises about PARSEC_V4N. Intent still holds, assertion re-pointed.
  • test_raises_clearly_when_task_dir_missing expected FileNotFoundError from resolving a single task — no longer a concept. I checked what the multi-task adapter actually does with an empty tasks dir: constructs fine, tasks("val") returns []. That's worth pinning because it doesn't raise — a run against the wrong checkout would otherwise "succeed" having measured nothing, and the zero task count is the only signal.

…e shared pieces

scripts/parsec/ -> examples/parsec/, where the other benchmarks live. All moves
are git mv, so history follows.

The shared pieces come up to the example root, which both matches the
examples/<name>/{adapters,optimizer}/ convention and drops an indirection that
was never meaningful:

    v4_t2_e1/common/adapters/  -> adapters/
    v4_t2_e1/common/optimizer/ -> optimizer/
    v4_t2_e1/common/parsec_paths.py -> parsec_paths.py
    v4_t2_e1/tests/            -> tests/

The adapter and optimizer were already shared rather than copied — both arms
symlink the same files into every generated project — so keeping them nested
inside one arm's directory misrepresented the dependency. h4's constant was
literally named V4T2_DIR while pointing at files it co-owns; it is now
EXAMPLE_DIR.

Path fixes:

  * adapter.py's _REPO_ROOT: parents[5] -> parents[3], two levels shallower.
    _COMMON_DIR stays parents[1] — it resolved to common/ and now resolves to
    the example root, which is where parsec_paths.py went.
  * every arm driver's REPO_ROOT stays parents[3]: scripts/parsec/<arm>/ and
    examples/parsec/<arm>/ are the same depth.
  * tests/ moved up one level, so parents[1]/"common"/"adapters" -> parents[1]/
    "adapters", parents[4]/"core" -> parents[3]/"core", and the three driver
    modules are now reached through parents[1]/"v4_t2_e1".
  * COMMON_ADAPTERS_SRC/COMMON_OPTIMIZER_SRC in both scaffolds now resolve from
    the example root instead of a common/ child.

Also updated outside the moved tree: RUN_H4.md, docs/how-to/ccc/
CCC_PODMAN_SETUP.md, scripts/ccc/parsec_stack.sh and .gitignore all named the
old path. Repo-wide grep for "scripts/parsec" is now empty.

Adds examples/parsec/README.md — short, in the shape of toy_calc's and
toy_skill's rather than the three PROMPT.md files, because those are
paste-to-your-agent intake prompts and parsec was onboarded months ago by a
different route; writing one would describe a flow that never happened. It
covers the layout, the two env vars and why neither has a default, that the
bundles and results live on the parsec-history branch, and the three
trial-integrity detectors under h4/audit/.

Tests: 69 pass. The 2 failures in test_adapter.py are pre-existing on main
(stale TASK_ID assertions, flagged in #694) and fail identically before this
change; the next commit addresses them separately.

Signed-off-by: boazc <boazc@il.ibm.com>
Both have failed on main since TASK_ID support was removed from the adapter
(flagged in #694, unrelated to the move in the previous commit). Separate
commit so it can be dropped on its own.

test_raises_clearly_when_task_id_unset asserted "TASK_ID" appears in the
construction error. The adapter now raises about PARSEC_V4N instead, so the
assertion was stale while its intent — an unconfigured checkout must stop
construction rather than default to one — still holds. Renamed and re-pointed
at the message actually raised.

test_raises_clearly_when_task_dir_missing expected FileNotFoundError from
resolving a single task that no longer exists as a concept. Verified what the
multi-task adapter actually does with an empty tasks dir: it constructs fine
and tasks("val") returns []. That is worth pinning precisely BECAUSE it does
not raise — a run against the wrong checkout would otherwise "succeed" having
measured nothing, and a zero task count is the only signal it happened.

Suite is now 71 passed, 0 failed.

Signed-off-by: boazc <boazc@il.ibm.com>
@skillberry-bot skillberry-bot added tech-debt Dead code, duplication, refactors documentation Improvements or additions to documentation dx Developer/onboarding experience labels Oct 12, 2026
@skillberry-bot

Copy link
Copy Markdown
Contributor

🏷️ Automatic Labeling

I've analyzed this pull request and added the following labels:

  • tech-debt - documentation - tech-debt - documentation - dx

These labels were selected based on the PR title, description, and changed files. If you believe any labels are incorrect or missing, feel free to adjust them manually.

…mples/parsec

Finishes what the previous commits started — nothing parsec-specific is left
outside examples/parsec/.

scripts/ccc/ was mixed. Four of its eight files mention parsec 8-52 times; the
other four mention it zero times. Moving only parsec_stack.sh (the one actually
asked about) would have left its two callers behind and kept the directory
mixed, so all four parsec scripts move together:

    RUN_H4.md                      -> examples/parsec/RUN_H4.md
    scripts/ccc/parsec_stack.sh     -> examples/parsec/ccc/
    scripts/ccc/parsec_bootstrap.sh -> examples/parsec/ccc/
    scripts/ccc/run_ccc_parsec.sh   -> examples/parsec/ccc/
    scripts/ccc/run_ccc_parsec_g2.sh -> examples/parsec/ccc/

scripts/ccc/ now holds only the benchmark-agnostic four
(run_ccc_experiment.sh, run_ccc_smoke.sh, setup_podman.sh,
submit_ccc_experiment.sh), which is a cleaner split than before: none of them
referenced any of the moved scripts.

Only one path change was needed. parsec_stack.sh and parsec_bootstrap.sh have
no self-location logic at all — they derive everything from $PARSEC_V4N and
--tree respectively — so they move untouched apart from their usage comments.
The two run wrappers compute PROJECT_ROOT from their own directory, so
$SCRIPT_DIR/../.. becomes ../../.. ; verified it still resolves to the repo
root from the new depth.

References updated in 7 files, including docs/how-to/ccc/CCC_PODMAN_SETUP.md
and the usage lines inside the moved scripts themselves. Repo-wide grep for
scripts/ccc/parsec and scripts/ccc/run_ccc_parsec is empty, RUN.md never
referenced any of this, and all seven shell scripts pass bash -n.

Tests still 71 passed, 0 failed.

Signed-off-by: boazc <boazc@il.ibm.com>
@bcarmeli
bcarmeli merged commit f228b42 into main Oct 12, 2026
16 checks passed
@bcarmeli
bcarmeli deleted the parsec/move-to-examples branch October 14, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation dx Developer/onboarding experience tech-debt Dead code, duplication, refactors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants