Skip to content

FE-1412: Scale the Python client's timeout for seeded trials - #9229

Draft
kube wants to merge 1 commit into
cf/fe-1270-create-python-bindings-to-petrinaut-corefrom
cf/fe-1412-python-client-support-seeded-trials-in-the-optimizer-service
Draft

FE-1412: Scale the Python client's timeout for seeded trials#9229
kube wants to merge 1 commit into
cf/fe-1270-create-python-bindings-to-petrinaut-corefrom
cf/fe-1412-python-client-support-seeded-trials-in-the-optimizer-service

Conversation

@kube

@kube kube commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

🌟 What is the purpose of this PR?

Top of the FE-1408 stack: makes the Python side ready for trials that run multiple seeded simulations. The seeded runs execute sequentially in the CLI, so one optimization.evaluate may legally take seedsPerTrial × the single-run time — the client's fixed 240 s response deadline must scale with it.

Stack #9226: FE-1410FE-1411FE-1408FE-1413FE-1270this PR.

🔗 Related links

  • FE-1412 (internal) — this PR
  • FE-1408 (internal) — parent: seeded trials in the CLI

🔍 What does this change?

@local/petrinaut-python (consumed by apps/petrinaut-opt):

  • OptimizationSession.describe_optimization() validates the reported study.seedsPerTrial (integer, 1–100; protocol error otherwise) and multiplies the per-response deadline by it.
  • A new end-to-end test drives a two-seed trial against the real built CLI, asserting the derived seed sequence [42, 1013904268], the per-seed replicates, and the mean objective.
  • The optimizer README documents the sequential seeded-runs behaviour and the scaled deadline.

No image changes: the seeded runs are sequential, so no worker permissions or pool caps are needed.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • modifies workspaces but not a publishable library

📜 Does this require a change to the docs?

The changes in this PR:

  • require changes to docs which are made as part of this PR (bindings + optimizer READMEs)

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

🛡 What tests cover this?

  • Bindings (26 tests): timeout scaling from the described seedsPerTrial, rejection of invalid values, and the sequential two-seed e2e against the real bundle.
  • petrinaut-opt: full suite (75) unchanged and green.

❓ How to test this?

turbo run test:unit --filter @local/petrinaut-python --filter @apps/petrinaut-opt

🤖 Generated with Claude Code

@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview Aug 20, 2026 10:53am
petrinaut Ready Ready Preview Aug 20, 2026 10:53am
petrinaut-docs Ready Ready Preview Aug 20, 2026 10:53am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Aug 20, 2026 10:53am

@github-actions github-actions Bot added area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team area/tests New or updated tests area/apps labels Aug 16, 2026
@kube kube self-assigned this Aug 16, 2026
@kube
kube force-pushed the cf/fe-1412-python-client-support-seeded-trials-in-the-optimizer-service branch from 3eda58b to 63d0a20 Compare August 17, 2026 23:51
@kube
kube force-pushed the cf/fe-1412-python-client-support-seeded-trials-in-the-optimizer-service branch from 63d0a20 to 7007b77 Compare August 17, 2026 23:56
@kube kube changed the title FE-1412: Support seeded trials in the Python client and optimizer image FE-1412: Scale the Python client's timeout for seeded trials Aug 17, 2026
@kube
kube marked this pull request as ready for review August 17, 2026 23:56
Copilot AI balanced review requested due to automatic review settings August 17, 2026 23:56
@cursor

cursor Bot commented Aug 17, 2026

Copy link
Copy Markdown

PR Summary

Cursor Bugbot is generating a summary for commit 7007b77. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Scales Python optimization response timeouts for sequential seeded trials and documents the behavior.

Changes:

  • Validates seedsPerTrial and scales response deadlines.
  • Adds unit and CLI end-to-end coverage.
  • Documents seeded execution and timeout behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
session.py Stores the base response timeout.
optimization.py Validates seed count and scales timeouts.
test_optimization_session.py Tests scaling and invalid values.
test_e2e_cli.py Tests a two-seed CLI trial.
Python README.md Documents scaled deadlines.
Optimizer README.md Documents sequential seeded trials.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread libs/@local/petrinaut-python/src/petrinaut/optimization.py
@kube
kube force-pushed the cf/fe-1412-python-client-support-seeded-trials-in-the-optimizer-service branch from 2e527f6 to bc69cf3 Compare August 18, 2026 22:48
@github-actions github-actions Bot removed area/deps Relates to third-party dependencies (area) type/eng > frontend Owned by the @frontend team type/legal Owned by the @legal team labels Aug 18, 2026
@kube
kube force-pushed the cf/fe-1412-python-client-support-seeded-trials-in-the-optimizer-service branch from bc69cf3 to b8b924e Compare August 18, 2026 23:19
@kube
kube force-pushed the cf/fe-1412-python-client-support-seeded-trials-in-the-optimizer-service branch from b8b924e to c872ad2 Compare August 18, 2026 23:37
@kube
kube force-pushed the cf/fe-1412-python-client-support-seeded-trials-in-the-optimizer-service branch from c872ad2 to bd52c92 Compare August 19, 2026 09:03
@kube
kube force-pushed the cf/fe-1412-python-client-support-seeded-trials-in-the-optimizer-service branch from bd52c92 to 454b48b Compare August 19, 2026 09:40
With execution.seedsPerTrial, one optimization.evaluate may legally run
up to 100 simulations sequentially, so the bindings validate the
seedsPerTrial reported by optimization.describe (integer, 1-100) and
multiply the per-response deadline by it. A new end-to-end test drives
a two-seed trial against the real built CLI, asserting the derived seed
sequence, per-seed replicates, and the mean objective.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) area/tests New or updated tests type/eng > backend Owned by the @backend team

Development

Successfully merging this pull request may close these issues.

2 participants