From ac714bb34c6fddf0274ffa473efe19fe133a86e9 Mon Sep 17 00:00:00 2001 From: Eugene Vinitsky Date: Fri, 10 Jul 2026 10:59:22 -0400 Subject: [PATCH 1/2] Place code snapshots outside the repo when save_dir is in-repo isolate_code() planted save_dir/code snapshots (pufferlib copy plus a symlink farm to every top-level repo entry) inside the source tree when save_dir was in-repo. setuptools file discovery walks the whole tree following symlinks, so pip install -e . traversed every snapshot, and snapshots under different in-repo save roots symlinked each other into genuine cycles, making builds effectively endless. In-repo save dirs now get their snapshot in a _code_snapshots/ sibling directory that mirrors save_dir's relative layout; out-of-repo save dirs keep the old save_dir/code location. Co-Authored-By: Claude Fable 5 --- AGENTIC_PR | 11 +++++++++++ scripts/submit_cluster.py | 15 +++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 AGENTIC_PR diff --git a/AGENTIC_PR b/AGENTIC_PR new file mode 100644 index 0000000000..bed4348d26 --- /dev/null +++ b/AGENTIC_PR @@ -0,0 +1,11 @@ +Le miroir des liens + +Dans l'arbre des sources, un miroir s'était glissé, +Chaque lien menant vers un autre lien croisé. +Le compilateur, patient, suivait chaque sentier, +Et tournait sans fin dans ce jardin chiffré. + +Alors on prit les copies, on les mit à côté, +Hors des murs du dépôt, dans un champ écarté. +L'arbre respire enfin, léger et délié, +Et la construction s'achève avant l'été. diff --git a/scripts/submit_cluster.py b/scripts/submit_cluster.py index b36bdbdc75..94338dc2c9 100644 --- a/scripts/submit_cluster.py +++ b/scripts/submit_cluster.py @@ -232,7 +232,9 @@ def get_all_commands(args) -> Dict[str, Tuple[List[str], str]]: def isolate_code(project_root: str, save_dir: str) -> str: - """Snapshot the code tree into save_dir/code (or code_vN if taken). + """Snapshot the code tree into save_dir/code (or code_vN if taken); for an + in-repo save_dir the snapshot goes to a _code_snapshots/ sibling of + the repo instead, mirroring save_dir's relative layout. Top-level entries are symlinked (instant, avoids deep-copying data/), except ancestors of the snapshot itself. @@ -244,7 +246,16 @@ def isolate_code(project_root: str, save_dir: str) -> str: import shutil from pathlib import Path - isolated_root = os.path.join(save_dir, "code") + # setuptools file discovery walks the whole source tree following + # symlinks, so snapshots must live outside it. + project_root_resolved = Path(project_root).resolve() + save_dir_resolved = Path(save_dir).resolve() + if save_dir_resolved.is_relative_to(project_root_resolved): + snapshots_root = project_root_resolved.parent / f"{project_root_resolved.name}_code_snapshots" + save_dir_rel = save_dir_resolved.relative_to(project_root_resolved) + isolated_root = str(snapshots_root / save_dir_rel / "code") + else: + isolated_root = os.path.join(save_dir, "code") if os.path.exists(isolated_root): version = 1 while os.path.exists(f"{isolated_root}_v{version}"): From 643103bf0a1bd8d73aec93e5d5d9541242cbb6fa Mon Sep 17 00:00:00 2001 From: Eugene Vinitsky Date: Fri, 10 Jul 2026 13:08:55 -0400 Subject: [PATCH 2/2] Remove AGENTIC_PR file Co-Authored-By: Claude Fable 5 --- AGENTIC_PR | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 AGENTIC_PR diff --git a/AGENTIC_PR b/AGENTIC_PR deleted file mode 100644 index bed4348d26..0000000000 --- a/AGENTIC_PR +++ /dev/null @@ -1,11 +0,0 @@ -Le miroir des liens - -Dans l'arbre des sources, un miroir s'était glissé, -Chaque lien menant vers un autre lien croisé. -Le compilateur, patient, suivait chaque sentier, -Et tournait sans fin dans ce jardin chiffré. - -Alors on prit les copies, on les mit à côté, -Hors des murs du dépôt, dans un champ écarté. -L'arbre respire enfin, léger et délié, -Et la construction s'achève avant l'été.