FE-1412: Support seeded trials in the Python client and optimizer image - #9229
Draft
kube wants to merge 1 commit into
Conversation
With execution.seedsPerTrial, one optimization.evaluate may legally run up to 100 simulations, and enabling worker threads under Node's permission model changes the CLI's startup output. The bindings now skip Node startup diagnostics (the two-line --allow-worker SecurityWarning) while waiting for the readiness line, scale the per-response timeout by the seedsPerTrial reported by optimization.describe, and forward PETRINAUT_CLI_MAX_PARALLEL_SIMULATIONS into the child environment. The optimizer image grants --allow-worker and pins the parallel-simulations cap to 1 until the task's CPU/memory allocation is raised. A new end-to-end test drives a two-seed trial on real CLI worker threads from Python.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🌟 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. Until this layer, the deployed optimizer image cannot execute manifests with
execution.seedsPerTrial > 1— its Node permission flags lack--allow-workerand its fixed 240 s response deadline assumes one simulation per evaluate.Stack #9226: FE-1410 → FE-1411 → FE-1408 → FE-1413 → FE-1270 → this PR.
🔗 Related links
🔍 What does this change?
@local/petrinaut-python--allow-workerunder--permissionmakes Node print a two-line SecurityWarning (verified on the image's Node 22: the warning plus a(Use `node --trace-warnings ...`)hint that carries no(node:prefix) — without the skip, every run in the image would die at startup.OptimizationSession.describe_optimization()validates the reportedstudy.seedsPerTrial(integer, 1–100; protocol error otherwise) and multiplies the per-response deadline by it: one evaluate may now legally run that many sequential simulations._child_environmentforwardsPETRINAUT_CLI_MAX_PARALLEL_SIMULATIONSto the CLI child, so operators can cap the worker pool.apps/petrinaut-optimage--allow-workeradded to both Node permission flag sets.PETRINAUT_CLI_MAX_PARALLEL_SIMULATIONS=1pinned: production stays sequential until the task's CPU/memory allocation is raised — each simulation worker holds its own compiled model, and worker heaps are not capped by the main isolate's--max-old-space-size. README documents the behaviour and the scaled timeout.Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
🛡 What tests cover this?
seedsPerTrial, rejection of invalid values, env forwarding — plus a new end-to-end test that runs a two-seed trial on real CLI worker threads (PETRINAUT_CLI_MAX_PARALLEL_SIMULATIONS=2), asserting the derived seed sequence[42, 1013904268], the per-seedreplicates, and the mean objective.❓ How to test this?
🤖 Generated with Claude Code