Skip to content

PSPLIB generator, eval tick cap, pool holds every job - #4

Merged
dev0Guy merged 3 commits into
mainfrom
parallel-selfplay
Nov 25, 2026
Merged

dev0Guy merged 3 commits into
mainfrom
parallel-selfplay

Conversation

@dev0Guy

@dev0Guy dev0Guy commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #3 (these commits landed after it was merged):

  • psplib usage generator (psplib:path=<.sm file or dir>): PSPLIB activities as jobs, demand / availability scaled to cap; seeded random or sequential order. Paper: train.py --psplib.
  • paper/evaluate.py: episodes capped at --max-ticks (default 2000) with a truncated column, so a policy that keeps waiting can't hang evaluation.
  • Paper env: waiting pool = number of jobs, so no job is rejected.

🤖 Generated with Claude Code

Summary by Sourcery

Support PSPLIB workloads, bounded policy evaluation, and lossless waiting pools across the simulator and paper experiments.

New Features:

  • Add PSPLIB RCPSP activity workloads from individual files or directories, with seeded random or sequential template selection and normalized resource demands.
  • Expose PSPLIB workload configuration through the simulator and paper training CLIs.

Bug Fixes:

  • Prevent evaluation episodes from hanging by truncating them at a configurable tick limit and reporting truncation.
  • Ensure the paper environment can retain every job without rejecting arrivals.

Enhancements:

  • Persist workload configuration in checkpoints so PSPLIB-trained policies are evaluated in the matching environment.
  • Expand paper evaluation metrics and documentation for truncation and PSPLIB workloads.

Documentation:

  • Document PSPLIB workload setup, scaling, and usage in paper experiments.

Tests:

  • Add coverage for PSPLIB parsing, malformed instances, workload generation, deterministic ordering, and file/directory loading.

dev0Guy and others added 3 commits November 25, 2026 17:39
… truncated runs

A policy that keeps choosing wait made the episode run forever (the paper
env has no max_ticks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s rejected

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Activities of RCPSP .sm/.mm instances become job templates: duration and
renewable demand / availability scaled to cap; random (seeded) or
sequential order; precedence ignored. The registry reads a file or a
directory (sorted); the adapter only parses. Unit tests for parsing,
scaling, seeding and loading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Data structures

Define the PSPLIB activity templates and generator state used to turn renewable-resource profiles into jobs.

  • src/adapters/generators/psplib.zig L1-81

Increase the paper environment’s waiting-pool capacity to match its job count, preventing rejection of waiting jobs.

  • paper/ptrmcts.py L52-61, L94-106

API

Expose PSPLIB generator parsing and its public generator type through the adapters module.

  • src/adapters.zig L23-24

Add the PSPLIB generator specification and file-or-directory loader, and pass I/O through the generator registry interface.

  • src/app/registry.zig L16, L47-105, L330-332

Pass the I/O context into the generator registry when constructing the CLI simulator.

  • src/app/main.zig L90

Pass the initialized threaded I/O context into the generator registry when constructing the C API simulator.

  • src/app/capi.zig L125-126, L136 (removed lines)

Uses of the API

Add a PSPLIB environment configuration option and use it throughout training workers and saved checkpoints.

  • paper/train.py L90-93 (+6 small edits)

Implementation

Add the PSPLIB parser and tests for parsing, validation, scaled job profiles, deterministic ordering, and generator loading.

  • src/adapters/generators/psplib.zig L82-272
  • src/app/registry.zig L106-130

Cap evaluation episode duration, report whether an episode was truncated, and add the corresponding output column.

  • paper/evaluate.py L146-149 (+4 small edits)

Documentation

Document the larger waiting pool and how to train and run with PSPLIB workloads.

  • paper/README.md L26, L79-97

Lock files and vendored code

Update ignore rules for generated or local artifacts.

  • .gitignore L30

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 9 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/adapters/generators/psplib.zig" line_range="124" />
<code_context>
+            const n = try ints(row, &nums);
+            if (n < r) return error.InvalidInput;
+            var a: [max_res]u32 = @splat(0);
+            @memcpy(a[0..r], nums[0..r]);
+            avail = a;
+        }
</code_context>
<issue_to_address>
**Malformed instance crashes parser**

When a supplied PSPLIB file declares more than eight renewable resources and reaches `RESOURCEAVAILABILITIES` before a `REQUESTS/DURATIONS` section, `parse` copies `r` entries into the fixed eight-element availability array without first bounding `r`; a crafted instance with more than eight renewable resources and an availability section before any requests section triggers an out-of-bounds slice and terminates the process instead of returning `InvalidInput`.

Reject resource counts above `max_res` before copying availability values into the fixed-size array.
</issue_to_address>

### Comment 2
<location path="paper/evaluate.py" line_range="123" />
<code_context>
     ap.add_argument("--seed-start", type=int, default=EVAL_SEED_START)
     ap.add_argument("--sims", type=int, default=32, help="MCTS simulations per move (0 = skip ptr+mcts)")
     ap.add_argument("--policies", default=",".join(BUILTIN))
+    ap.add_argument("--max-ticks", type=int, default=2000,
+                    help="end (truncate) an episode after this many ticks; counted in the 'truncated' column")
     ap.add_argument("--device", default="cpu")
</code_context>
<issue_to_address>
**Invalid caps break evaluation**

When the effective `max_ticks` value is zero or negative, `SchedEnv` resets an already-finished engine for a zero cap, so `run` fails on its first `step`; for a negative cap, `sim_create` treats the value as no cap and a wait-only policy never ends, so evaluation fails or hangs.

Validate the effective cap from the CLI and checkpoint as positive before constructing `SchedEnv`.

Also at `paper/evaluate.py:149`.
</issue_to_address>

### Comment 3
<location path="src/adapters/generators/psplib.zig" line_range="111" />
<code_context>
+                var nums: [3 + 2 * max_res + 8]u32 = undefined;
+                const n = try ints(row, &nums);
+                // new activity: jobnr mode dur R.. N..; extra mode lines lack jobnr -> skipped (mode 1 only)
+                if (n != 3 + r + n_non) continue;
+                var e: @TypeOf(raw.items[0]) = .{ .dur = std.math.cast(u16, nums[2]) orelse return error.InvalidInput, .dem = @splat(0) };
+                @memcpy(e.dem[0..r], nums[3 .. 3 + r]);
</code_context>
<issue_to_address>
**Alternative modes distort workloads**

When a `.mm` instance has activities with more than one mode, `parse` accepts each mode row because the rows have the same number of fields, then appends every mode as a separate template without checking the mode number. Random and sequential workloads therefore include unintended modes and weight activities with more modes more heavily.

Filter `.mm` request rows to mode 1 before appending templates.

Also at `src/adapters/generators/psplib.zig:110`.
</issue_to_address>

### Comment 4
<location path="src/adapters/generators/psplib.zig" line_range="72" />
<code_context>
+            },
+        };
+        const a = self.acts[i];
+        const dur: u16 = @intCast(@min(a.dur, out.layout.n_ticks));
+        const c: f32 = @floatFromInt(self.cap);
+        for (0..out.layout.n_res) |res| {
</code_context>
<issue_to_address>
**PSPLIB durations are shortened**

When an activity duration exceeds the configured `n_ticks` horizon, `Psplib.job` clamps `a.dur` to `out.layout.n_ticks`, so the generated job has a shorter duration than the PSPLIB activity and schedules and metrics no longer reflect the input workload.

Preserve the parsed PSPLIB duration instead of clamping it to the horizon.
</issue_to_address>

### Comment 5
<location path="paper/ptrmcts.py" line_range="104" />
<code_context>
+        raise FileNotFoundError(path)
+    if "," in path or "=" in path:
+        raise ValueError(f"PSPLIB path must not contain ',' or '=': {path}")
+    return {**ENV_KW, "machines": f"psplib:path={path},n=1", "n_res": 4}
+
+
</code_context>
<issue_to_address>
**PSPLIB training rejects valid instances**

When the selected instance, or an instance in the selected directory, has fewer than four renewable resources, `--psplib` sets `n_res` to 4, so `Psplib.machine` rejects the request when the instance provides fewer renewable resources and `SchedEnv` construction fails before training starts.

Set `n_res` to a value supported by the selected PSPLIB instance instead of always fixing it at 4.
</issue_to_address>

### Comment 6
<location path="paper/evaluate.py" line_range="146" />
<code_context>
         if overlap:
             raise SystemExit(f"evaluation seeds {overlap[0]}.. were used in training ({used.start}..{used.stop - 1})")
-    env_kw = ck["env"] if ck else ENV_KW
+    env_kw = dict(ck["env"] if ck else ENV_KW)
+    # a policy that keeps choosing "wait" would otherwise never end the episode;
+    # every job has arrived long before this, so the cap does not change the workload
</code_context>
<issue_to_address>
**Checkpoint paths trigger local reads**

When a user evaluates an untrusted checkpoint whose environment selects a FIFO or a directory with a large number of `.sm`/`.mm` files, evaluation passes checkpoint-controlled `env["machines"]` to `SchedEnv`, and the PSPLIB generator reads the resulting path as the current user. A checkpoint pointing to a FIFO or a directory with many matching files can hang or exhaust the evaluation process, so users see a stuck or terminated run.

Validate checkpoint environment specs before constructing the environment, and restrict PSPLIB inputs to explicitly trusted regular files or bounded directories.

Also at `src/app/registry.zig:97`.
</issue_to_address>

### Comment 7
<location path="src/adapters/generators/psplib.zig" line_range="271" />
<code_context>
+            d.* = try g.job(.{ .id = 0, .arrival = 0 }, Usage.fromSlice(buf, layout));
+        }
+    }
+    try std.testing.expectEqualSlices(u16, &seqs[0], &seqs[1]);
+}
</code_context>
<issue_to_address>
**Random mode accepts one template**

When random selection is broken and always returns the first template, the `psplib: jobs follow the templates, scaled to cap; seeded and sequential` test passes: `expectEqualSlices` at line 271 only compares two runs, so always selecting the first template produces identical sequences. The test therefore accepts random mode that never selects other templates.

Assert that the reproducible sequence also selects more than one template.
</issue_to_address>

### Comment 8
<location path="src/adapters/generators/psplib.zig" line_range="255-257" />
<code_context>
+        try std.testing.expectEqual(want, dur);
+        const exp: [3]Elem = if (want == 3) .{ 20, 0, 20 } else .{ 0, 40, 10 };
+        for (0..3) |r| {
+            try std.testing.expectEqual(exp[r], u.resource(r)[0]);
+            try std.testing.expectEqual(exp[r], u.resource(r)[dur - 1]);
+            try std.testing.expectEqual(@as(Elem, 0), u.resource(r)[dur]);
+        }
+    }
</code_context>
<issue_to_address>
**Interior demand can be zero**

When the generator writes the expected demand at the endpoints but leaves interior ticks at zero, the `psplib: jobs follow the templates, scaled to cap; seeded and sequential` test passes if demands are written only at the first and last active ticks, with zeros between them: lines 255-257 check those endpoints and the tick after the job, but no interior tick. It therefore accepts a non-constant job profile.

Assert the expected demand at every tick in `0..dur` and zero at `dur`.
</issue_to_address>

### Comment 9
<location path="paper/evaluate.py" line_range="149" />
<code_context>
+    env_kw = dict(ck["env"] if ck else ENV_KW)
+    # a policy that keeps choosing "wait" would otherwise never end the episode;
+    # every job has arrived long before this, so the cap does not change the workload
+    env_kw["max_ticks"] = env_kw.get("max_ticks") or args.max_ticks
     env = SchedEnv(**env_kw)

</code_context>
<issue_to_address>
**Paper changes lack regression tests**

When the paper tick-cap and pool-size changes are merged without dedicated tests, the new evaluation tick-cap and reporting path, and the 80-slot paper pool configuration, can regress without any test failing; existing truncation coverage exercises engine behavior, not these paper changes.

Add paper-level tests for capped evaluation and truncated reporting, and for admitting all jobs with the configured pool.

Also at `paper/ptrmcts.py:61`.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

const n = try ints(row, &nums);
if (n < r) return error.InvalidInput;
var a: [max_res]u32 = @splat(0);
@memcpy(a[0..r], nums[0..r]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Malformed instance crashes parser

When a supplied PSPLIB file declares more than eight renewable resources and reaches RESOURCEAVAILABILITIES before a REQUESTS/DURATIONS section, parse copies r entries into the fixed eight-element availability array without first bounding r; a crafted instance with more than eight renewable resources and an availability section before any requests section triggers an out-of-bounds slice and terminates the process instead of returning InvalidInput.

Reject resource counts above max_res before copying availability values into the fixed-size array.

Prompt for AI agents
In `src/adapters/generators/psplib.zig` at line 124:

**Malformed instance crashes parser**

When a supplied PSPLIB file declares more than eight renewable resources and reaches `RESOURCEAVAILABILITIES` before a `REQUESTS/DURATIONS` section, `parse` copies `r` entries into the fixed eight-element availability array without first bounding `r`; a crafted instance with more than eight renewable resources and an availability section before any requests section triggers an out-of-bounds slice and terminates the process instead of returning `InvalidInput`.

Reject resource counts above `max_res` before copying availability values into the fixed-size array.

Comment thread paper/evaluate.py
ap.add_argument("--seed-start", type=int, default=EVAL_SEED_START)
ap.add_argument("--sims", type=int, default=32, help="MCTS simulations per move (0 = skip ptr+mcts)")
ap.add_argument("--policies", default=",".join(BUILTIN))
ap.add_argument("--max-ticks", type=int, default=2000,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Invalid caps break evaluation

When the effective max_ticks value is zero or negative, SchedEnv resets an already-finished engine for a zero cap, so run fails on its first step; for a negative cap, sim_create treats the value as no cap and a wait-only policy never ends, so evaluation fails or hangs.

Validate the effective cap from the CLI and checkpoint as positive before constructing SchedEnv.

Also at paper/evaluate.py:149.

Prompt for AI agents
In `paper/evaluate.py` at line 123:

**Invalid caps break evaluation**

When the effective `max_ticks` value is zero or negative, `SchedEnv` resets an already-finished engine for a zero cap, so `run` fails on its first `step`; for a negative cap, `sim_create` treats the value as no cap and a wait-only policy never ends, so evaluation fails or hangs.

Validate the effective cap from the CLI and checkpoint as positive before constructing `SchedEnv`.

Also at `paper/evaluate.py:149`.

var nums: [3 + 2 * max_res + 8]u32 = undefined;
const n = try ints(row, &nums);
// new activity: jobnr mode dur R.. N..; extra mode lines lack jobnr -> skipped (mode 1 only)
if (n != 3 + r + n_non) continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High · Alternative modes distort workloads

When a .mm instance has activities with more than one mode, parse accepts each mode row because the rows have the same number of fields, then appends every mode as a separate template without checking the mode number. Random and sequential workloads therefore include unintended modes and weight activities with more modes more heavily.

Filter .mm request rows to mode 1 before appending templates.

Also at src/adapters/generators/psplib.zig:110.

Prompt for AI agents
In `src/adapters/generators/psplib.zig` at line 111:

**Alternative modes distort workloads**

When a `.mm` instance has activities with more than one mode, `parse` accepts each mode row because the rows have the same number of fields, then appends every mode as a separate template without checking the mode number. Random and sequential workloads therefore include unintended modes and weight activities with more modes more heavily.

Filter `.mm` request rows to mode 1 before appending templates.

Also at `src/adapters/generators/psplib.zig:110`.

},
};
const a = self.acts[i];
const dur: u16 = @intCast(@min(a.dur, out.layout.n_ticks));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · PSPLIB durations are shortened

When an activity duration exceeds the configured n_ticks horizon, Psplib.job clamps a.dur to out.layout.n_ticks, so the generated job has a shorter duration than the PSPLIB activity and schedules and metrics no longer reflect the input workload.

Preserve the parsed PSPLIB duration instead of clamping it to the horizon.

Prompt for AI agents
In `src/adapters/generators/psplib.zig` at line 72:

**PSPLIB durations are shortened**

When an activity duration exceeds the configured `n_ticks` horizon, `Psplib.job` clamps `a.dur` to `out.layout.n_ticks`, so the generated job has a shorter duration than the PSPLIB activity and schedules and metrics no longer reflect the input workload.

Preserve the parsed PSPLIB duration instead of clamping it to the horizon.

Comment thread paper/ptrmcts.py
raise FileNotFoundError(path)
if "," in path or "=" in path:
raise ValueError(f"PSPLIB path must not contain ',' or '=': {path}")
return {**ENV_KW, "machines": f"psplib:path={path},n=1", "n_res": 4}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · PSPLIB training rejects valid instances

When the selected instance, or an instance in the selected directory, has fewer than four renewable resources, --psplib sets n_res to 4, so Psplib.machine rejects the request when the instance provides fewer renewable resources and SchedEnv construction fails before training starts.

Set n_res to a value supported by the selected PSPLIB instance instead of always fixing it at 4.

Prompt for AI agents
In `paper/ptrmcts.py` at line 104:

**PSPLIB training rejects valid instances**

When the selected instance, or an instance in the selected directory, has fewer than four renewable resources, `--psplib` sets `n_res` to 4, so `Psplib.machine` rejects the request when the instance provides fewer renewable resources and `SchedEnv` construction fails before training starts.

Set `n_res` to a value supported by the selected PSPLIB instance instead of always fixing it at 4.

Comment thread paper/evaluate.py
if overlap:
raise SystemExit(f"evaluation seeds {overlap[0]}.. were used in training ({used.start}..{used.stop - 1})")
env_kw = ck["env"] if ck else ENV_KW
env_kw = dict(ck["env"] if ck else ENV_KW)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Checkpoint paths trigger local reads

When a user evaluates an untrusted checkpoint whose environment selects a FIFO or a directory with a large number of .sm/.mm files, evaluation passes checkpoint-controlled env["machines"] to SchedEnv, and the PSPLIB generator reads the resulting path as the current user. A checkpoint pointing to a FIFO or a directory with many matching files can hang or exhaust the evaluation process, so users see a stuck or terminated run.

Validate checkpoint environment specs before constructing the environment, and restrict PSPLIB inputs to explicitly trusted regular files or bounded directories.

Also at src/app/registry.zig:97.

Prompt for AI agents
In `paper/evaluate.py` at line 146:

**Checkpoint paths trigger local reads**

When a user evaluates an untrusted checkpoint whose environment selects a FIFO or a directory with a large number of `.sm`/`.mm` files, evaluation passes checkpoint-controlled `env["machines"]` to `SchedEnv`, and the PSPLIB generator reads the resulting path as the current user. A checkpoint pointing to a FIFO or a directory with many matching files can hang or exhaust the evaluation process, so users see a stuck or terminated run.

Validate checkpoint environment specs before constructing the environment, and restrict PSPLIB inputs to explicitly trusted regular files or bounded directories.

Also at `src/app/registry.zig:97`.

d.* = try g.job(.{ .id = 0, .arrival = 0 }, Usage.fromSlice(buf, layout));
}
}
try std.testing.expectEqualSlices(u16, &seqs[0], &seqs[1]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Random mode accepts one template

When random selection is broken and always returns the first template, the psplib: jobs follow the templates, scaled to cap; seeded and sequential test passes: expectEqualSlices at line 271 only compares two runs, so always selecting the first template produces identical sequences. The test therefore accepts random mode that never selects other templates.

Assert that the reproducible sequence also selects more than one template.

Prompt for AI agents
In `src/adapters/generators/psplib.zig` at line 271:

**Random mode accepts one template**

When random selection is broken and always returns the first template, the `psplib: jobs follow the templates, scaled to cap; seeded and sequential` test passes: `expectEqualSlices` at line 271 only compares two runs, so always selecting the first template produces identical sequences. The test therefore accepts random mode that never selects other templates.

Assert that the reproducible sequence also selects more than one template.

Comment on lines +255 to +257
try std.testing.expectEqual(exp[r], u.resource(r)[0]);
try std.testing.expectEqual(exp[r], u.resource(r)[dur - 1]);
try std.testing.expectEqual(@as(Elem, 0), u.resource(r)[dur]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Interior demand can be zero

When the generator writes the expected demand at the endpoints but leaves interior ticks at zero, the psplib: jobs follow the templates, scaled to cap; seeded and sequential test passes if demands are written only at the first and last active ticks, with zeros between them: lines 255-257 check those endpoints and the tick after the job, but no interior tick. It therefore accepts a non-constant job profile.

Assert the expected demand at every tick in 0..dur and zero at dur.

Prompt for AI agents
In `src/adapters/generators/psplib.zig` at lines 255-257:

**Interior demand can be zero**

When the generator writes the expected demand at the endpoints but leaves interior ticks at zero, the `psplib: jobs follow the templates, scaled to cap; seeded and sequential` test passes if demands are written only at the first and last active ticks, with zeros between them: lines 255-257 check those endpoints and the tick after the job, but no interior tick. It therefore accepts a non-constant job profile.

Assert the expected demand at every tick in `0..dur` and zero at `dur`.

Comment thread paper/evaluate.py
env_kw = dict(ck["env"] if ck else ENV_KW)
# a policy that keeps choosing "wait" would otherwise never end the episode;
# every job has arrived long before this, so the cap does not change the workload
env_kw["max_ticks"] = env_kw.get("max_ticks") or args.max_ticks

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Paper changes lack regression tests

When the paper tick-cap and pool-size changes are merged without dedicated tests, the new evaluation tick-cap and reporting path, and the 80-slot paper pool configuration, can regress without any test failing; existing truncation coverage exercises engine behavior, not these paper changes.

Add paper-level tests for capped evaluation and truncated reporting, and for admitting all jobs with the configured pool.

Also at paper/ptrmcts.py:61.

Prompt for AI agents
In `paper/evaluate.py` at line 149:

**Paper changes lack regression tests**

When the paper tick-cap and pool-size changes are merged without dedicated tests, the new evaluation tick-cap and reporting path, and the 80-slot paper pool configuration, can regress without any test failing; existing truncation coverage exercises engine behavior, not these paper changes.

Add paper-level tests for capped evaluation and truncated reporting, and for admitting all jobs with the configured pool.

Also at `paper/ptrmcts.py:61`.

From CLAUDE.md L29-31:

- Every behavior change needs a test; integration tests in tests/. Engine
  semantics: add a hand-worked case to tests/scenario_test.zig; the
  `property:` test there checks against a naive reference simulator.

@dev0Guy
dev0Guy merged commit ecdd138 into main Nov 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant