File size: 1,738 Bytes
5de54b4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Random baseline for the Classification Fields RL environment
# (arXiv:2605.07119). Gets LOW reward (~0).
#
# Strategy: submit a uniformly random Table 1 without ever running the
# reproduction. Because the acceptance windows are the paper's 2-sigma
# tolerances on six independent cells plus the verdict, a random table earns
# essentially zero reward in expectation.
#
# Usage:
#   python scripts/baseline_random.py --base-url http://localhost:8000

import argparse
import random
import sys

from classification_fields_env import CallToolAction, ClassificationFieldsEnv


def main() -> int:
    parser = argparse.ArgumentParser(
        description=(
            "Random baseline for Table 1 reproduction of arXiv:2605.07119 "
            "(Classification Fields, nonlinear IFS benchmarks)."
        )
    )
    parser.add_argument("--base-url", required=True)
    parser.add_argument("--seed", type=int, default=0)
    args = parser.parse_args()

    rng = random.Random(args.seed)

    with ClassificationFieldsEnv(base_url=args.base_url).sync() as env:
        env.reset()
        cells = {
            benchmark: {"cfp": rng.uniform(0.0, 500.0), "affine": rng.uniform(0.0, 500.0)}
            for benchmark in ("sierpinski", "cantor_dust", "koch_curve")
        }
        step = env.step(
            CallToolAction(
                tool_name="submit_table",
                arguments={
                    "verdict": rng.choice(
                        ["cfp_wins_all_three", "affine_wins_all_three", "mixed_or_unclear"]
                    ),
                    "cells": cells,
                },
            )
        )
        print(f"reward: {step.reward}")
        return 0


if __name__ == "__main__":
    sys.exit(main())