避免四舍五入和缺区间把还可能的时间从目前范围里藏掉。
Co-Authored-By: Grok (agent loop)
This commit is contained in:
co-authored by
Grok (agent loop)
parent
25c51ff0d0
commit
1ba473970f
@@ -29,6 +29,10 @@ def main() -> int:
|
||||
parser.add_argument("--output", required=True)
|
||||
parser.add_argument("--limit", type=int, default=10)
|
||||
parser.add_argument("--radii", default="10,30,60")
|
||||
parser.add_argument("--study", action="store_true")
|
||||
parser.add_argument("--modes", default="all_correct,flip_1,flip_3,flip_5")
|
||||
parser.add_argument("--orderings", default="off")
|
||||
parser.add_argument("--code-sha", default="")
|
||||
args = parser.parse_args()
|
||||
target = Path(args.output)
|
||||
if target.exists():
|
||||
@@ -58,13 +62,32 @@ def main() -> int:
|
||||
thread.start()
|
||||
try:
|
||||
env = {**os.environ, "JYOTISH_API_BASE": origin}
|
||||
body: dict = {"rows": rows}
|
||||
if args.study:
|
||||
body["study"] = {
|
||||
"modes": [item for item in args.modes.split(",") if item],
|
||||
"orderings": [item for item in args.orderings.split(",") if item],
|
||||
"code_sha": args.code_sha,
|
||||
}
|
||||
result = subprocess.run(["node", "--import", "tsx", "tests/research/rectification-segment-persisted-replay.ts"],
|
||||
cwd=ROOT / "frontend", env=env, input=json.dumps({"rows": rows}),
|
||||
cwd=ROOT / "frontend", env=env, input=json.dumps(body),
|
||||
text=True, encoding="utf-8", stdout=subprocess.PIPE, check=False)
|
||||
payload = json.loads(result.stdout)
|
||||
payload.update({"python_version": platform.python_version(),
|
||||
"dataset_sha256": hashlib.sha256(Path(args.dataset).read_bytes()).hexdigest(),
|
||||
"runner_exit": result.returncode})
|
||||
if args.study:
|
||||
for row in payload.get("records") or []:
|
||||
if isinstance(row, dict):
|
||||
for key in ("asked", "gates", "ledger_before", "ledger_after", "metrics", "targets", "domain"):
|
||||
row.pop(key, None)
|
||||
payload["rerun"] = {
|
||||
"command": "python scripts/research/varga_resolution_persisted_replay.py --study "
|
||||
f"--modes {args.modes} --orderings {args.orderings} --radii {args.radii} "
|
||||
f"--limit {args.limit} --code-sha {args.code_sha or '<HEAD>'} --output <new-file>",
|
||||
"max_rounds": "DEFAULT_MAX_DISCRIMINATION_ROUNDS",
|
||||
"truth_clock": "omitted; real-case calibration stores containment booleans only",
|
||||
}
|
||||
target.parent.mkdir(parents=True, exist_ok=True)
|
||||
with target.open("x", encoding="utf-8") as stream:
|
||||
stream.write(json.dumps(payload, ensure_ascii=False, sort_keys=True, indent=2) + "\n")
|
||||
|
||||
Reference in New Issue
Block a user