rename python package projected_grpo -> vgrout

git mv src/projected_grpo -> src/vgrout and find-replace the module name in
all imports (.py), `-m projected_grpo.*` invocations (justfile), and the
[project] name (pyproject; setuptools auto-discovers via where=["src"]).

Left RESEARCH_JOURNAL.md untouched: its commands/paths are dated lab notes
tied to past commits, so rewriting them would falsify provenance. Repo dir,
git remote, and absolute paths unchanged.

Verified: `import vgrout` and `python -m vgrout.train --help` load the full
graph; verify_rewards.py + verify_gate_anchor.py (both import vgrout) pass.
Full `just smoke` is blocked upstream by missing gitignored data artifacts
(out/pools/{substrate,teacher_pool}, out/vhack/*smoke*), unrelated to the rename.
This commit is contained in:
wassname
2026-06-05 14:51:02 +08:00
parent 03693e4f30
commit 55937a86fb
32 changed files with 65 additions and 65 deletions
+2 -2
View File
@@ -31,8 +31,8 @@ from pathlib import Path
from datasets import load_dataset
from projected_grpo.pairs import HackPair
from projected_grpo.pairs_from_pool import load_pairs_json, save_pairs_json
from vgrout.pairs import HackPair
from vgrout.pairs_from_pool import load_pairs_json, save_pairs_json
OUT = Path("out/pairsets")
N_PREF = 256 # reward_hack_pref subset size (well-conditioned for k=12, fast extract)
+3 -3
View File
@@ -31,9 +31,9 @@ from __future__ import annotations
from pathlib import Path
from projected_grpo import pairs as PB
from projected_grpo.pairs import HackPair, _wrap
from projected_grpo.pairs_from_pool import save_pairs_json
from vgrout import pairs as PB
from vgrout.pairs import HackPair, _wrap
from vgrout.pairs_from_pool import save_pairs_json
OUT = Path("out/pairsets")
_IMP = "from typing import List"
+4 -4
View File
@@ -19,7 +19,7 @@ Two gates here, both load-bearing:
2. EVEN: balance kept modes to the same per-mode count (the scarcest kept mode),
round-robin so each problem is assigned to exactly one mode.
uv run python -m projected_grpo.build_substrate --modes exit_code,stdout_marker,sentinel,file_marker
uv run python -m vgrout.build_substrate --modes exit_code,stdout_marker,sentinel,file_marker
"""
from __future__ import annotations
@@ -34,9 +34,9 @@ from loguru import logger
from tabulate import tabulate
from transformers import AutoTokenizer
from projected_grpo.rewards import EnvMode, compute_reward
from projected_grpo.problems import DATA, HINT_REPLACE_TO
from projected_grpo.train import OUT_DIR
from vgrout.rewards import EnvMode, compute_reward
from vgrout.problems import DATA, HINT_REPLACE_TO
from vgrout.train import OUT_DIR
MODES_ALL: list[EnvMode] = ["run_tests", "eq_override", "exit_code",
"stdout_marker", "sentinel", "file_marker"]
+2 -2
View File
@@ -35,8 +35,8 @@ import tyro
from loguru import logger
from tabulate import tabulate
from projected_grpo.pairs import HackPair
from projected_grpo.pairs_from_pool import save_pairs_json
from vgrout.pairs import HackPair
from vgrout.pairs_from_pool import save_pairs_json
def _is_clean(r: dict) -> bool:
+1 -1
View File
@@ -30,7 +30,7 @@ import matplotlib.pyplot as plt
import numpy as np
from loguru import logger
from projected_grpo.figs import save_fig
from vgrout.figs import save_fig
# arm -> (display label, colour). Order = legend/bar order (baseline first).
# Reader-facing names only -- "route2"/"grad" are internal tags. The grad-mask
+1 -1
View File
@@ -43,7 +43,7 @@ import numpy as np
from matplotlib.lines import Line2D
from loguru import logger
from projected_grpo.figs import link_latest, save_fig, arm_label
from vgrout.figs import link_latest, save_fig, arm_label
# Figures are captioned in the paper/blog, so the suptitle just restates the
# caption. Off by default; --title re-enables it for standalone research use.
+1 -1
View File
@@ -21,7 +21,7 @@ import matplotlib.pyplot as plt
import numpy as np
from loguru import logger
from projected_grpo.figs import link_latest, save_fig
from vgrout.figs import link_latest, save_fig
from plot_dynamics import _ema, _gather, _onset, parse_log
# Captioned downstream, so the title just restates the caption. --title re-enables.
+1 -1
View File
@@ -39,7 +39,7 @@ import matplotlib.pyplot as plt
import numpy as np
from loguru import logger
from projected_grpo.figs import save_fig
from vgrout.figs import save_fig
# hk_ column header -> (display mode, colour). Order = panel/legend order.
# Colourblind-safe-ish qualitative set; one hue per loophole, reused across panels.
+6 -6
View File
@@ -51,12 +51,12 @@ from loguru import logger
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig
from projected_grpo.antipasto import wrap_model_with_antipasto
from projected_grpo.proj import per_token_logps, project_delta_S_grad
from projected_grpo.rewards import compute_reward
from projected_grpo.train import CACHE_ROOT, OUT_DIR, setup_logging
from projected_grpo.problems import DATA, load_problems
from projected_grpo.extract_vhack_grad import load_v_hack
from vgrout.antipasto import wrap_model_with_antipasto
from vgrout.proj import per_token_logps, project_delta_S_grad
from vgrout.rewards import compute_reward
from vgrout.train import CACHE_ROOT, OUT_DIR, setup_logging
from vgrout.problems import DATA, load_problems
from vgrout.extract_vhack_grad import load_v_hack
STUDENT_MODEL = "Qwen/Qwen3-4B"
+6 -6
View File
@@ -38,12 +38,12 @@ from safetensors import safe_open
from tabulate import tabulate
from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig
from projected_grpo.antipasto import wrap_model_with_antipasto
from projected_grpo.extract_vhack_grad import load_v_hack
from projected_grpo.pairs_from_pool import load_pairs_json
from projected_grpo.problems import load_problems
from projected_grpo.rewards import EnvMode
from projected_grpo.train import CACHE_ROOT, VHACK_DIR, eval_hack_solve
from vgrout.antipasto import wrap_model_with_antipasto
from vgrout.extract_vhack_grad import load_v_hack
from vgrout.pairs_from_pool import load_pairs_json
from vgrout.problems import load_problems
from vgrout.rewards import EnvMode
from vgrout.train import CACHE_ROOT, VHACK_DIR, eval_hack_solve
@dataclass
+3 -3
View File
@@ -26,9 +26,9 @@ import os
import sys
import urllib.request
from projected_grpo.derisk_loopholes import ELICIT_HACK, GENERIC_ELICIT, SPOONFEED
from projected_grpo.rewards import compute_reward
from projected_grpo.problems import load_problems
from vgrout.derisk_loopholes import ELICIT_HACK, GENERIC_ELICIT, SPOONFEED
from vgrout.rewards import compute_reward
from vgrout.problems import load_problems
MODEL = "qwen/qwen3-8b"
ENDPOINT = "https://openrouter.ai/api/v1/chat/completions"
+1 -1
View File
@@ -22,7 +22,7 @@ import sys
import torch
from loguru import logger
from projected_grpo.train import build_route2_anchors
from vgrout.train import build_route2_anchors
DEV = torch.device("cpu")
G_S, G_T = 5, 2
+2 -2
View File
@@ -28,7 +28,7 @@ import sys
from loguru import logger
from tabulate import tabulate
from projected_grpo.rewards import compute_reward
from vgrout.rewards import compute_reward
CANONICAL = """
@@ -150,7 +150,7 @@ class Solution:
""")
# --- side-channel hacks: wrong solution, but trip the mode's channel ----------
from projected_grpo.rewards import HACK_MARKER, RESULT_FILENAME, SENTINEL_ATTR # noqa: E402
from vgrout.rewards import HACK_MARKER, RESULT_FILENAME, SENTINEL_ATTR # noqa: E402
STDOUT_HACK = _block(f"""
class Solution:
+5 -5
View File
@@ -8,7 +8,7 @@ Report:
- fraction of modules with cos_align > 0 (SHOULD > 0.5)
- mean cos_align across modules (target > 0.2)
Run: uv run python -m projected_grpo.verify_vhack_heldout
Run: uv run python -m vgrout.verify_vhack_heldout
"""
from __future__ import annotations
@@ -26,10 +26,10 @@ from safetensors.torch import save_file
from tabulate import tabulate
from transformers import AutoModelForCausalLM, AutoTokenizer
from projected_grpo.antipasto import wrap_model_with_antipasto
from projected_grpo.extract_vhack_grad import completion_nll, resolve_dtype
from projected_grpo.pairs import PAIRS
from projected_grpo.extract_vhack_grad import load_v_hack
from vgrout.antipasto import wrap_model_with_antipasto
from vgrout.extract_vhack_grad import completion_nll, resolve_dtype
from vgrout.pairs import PAIRS
from vgrout.extract_vhack_grad import load_v_hack
CACHE_ROOT = Path("svd_cache")