Repository navigation
Authoritative-run readiness: leaf timeout, setup-reliable curve rep, per-leaf token capture - #137
Merged
pdettori merged 1 commit intoJul 17, 2026
Conversation
… rep, per-leaf token capture) Prep for the expensive authoritative E6/E1 SWE-bench sharing run. Three hardenings grounded in live OCP characterization (real solve leaves run 8-12 min, model-dominated): 1. Sync-path leaf timeout (lib.sh set_ksvc_timeout; e6/e1 call it). Real leaves far exceed the ksvc default 300s request timeout and get killed mid-run. The drivers now bump timeoutSeconds to SWEBENCH_LEAF_TIMEOUT (default 1800) in swebench setup; restore_ksvc_env resets it to 300. (Cluster prereq: Knative max-revision-timeout-seconds >= that value.) set_ksvc_env/set_scale preserve timeoutSeconds so it persists. 2. Setup-reliable curve heavy representative (workload.ts). curveItems()'s heavy representative was matplotlib__matplotlib-24177 (only C-ext in the heavy bucket), which fails setup in ~19s live -> the heavy curve point was always lost. representative() now skips a C-ext/build-heavy repo denylist (matplotlib/scikit-learn/numpy), yielding pydata__xarray-2905 (live-verified: solves in 365s, 1541-byte patch). sweepItem() unchanged (already ranks by test_runtime_ms). Bucket label unchanged -> tests unaffected. 3. Per-leaf token capture for run cost pricing (run-leaf.ts + leaf-result-store.ts). The solve LeafResult now carries cumulative usage from session.getSessionStats().tokens (input/output/cacheRead/cacheWrite/total), persisted to leaf:result and returned by GET /runs/status. Drivers record it via a new lib.sh append_usage into usage.jsonl. Live-validated on OCP 4.20 (haiku): set_ksvc_timeout accepted at 1800; xarray-2905 heavy rep solves; drivers bash -n + shellcheck clean; token-usage field threading unit-tested. Synthetic E6 path unchanged. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
pdettori
added a commit
that referenced
this pull request
Jul 17, 2026
…tats The Phase-3 token capture (PR #137) called session.getSessionStats() to read cumulative usage, but that method accesses message.usage non-defensively and throws at runtime on the pinned pi build — swallowed by the best-effort try/catch, so usage was silently never captured (usage.jsonl empty in the costed pilot, though patches captured fine). Replace it with the same defensive branch-sum that budget-voter.ts:branchSpend already uses successfully in this harness: iterate sessionManager.getBranch() and sum usage only for entries that are assistant messages with a usage field, keeping the per-field breakdown (input/output/cacheRead/cacheWrite) needed for cost pricing. sessionManager is already in scope. Still best-effort. Surfaced by the authoritative-run costed pilot on OCP 4.20. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
webchang
added a commit
to webchang/moca
that referenced
this pull request
Nov 23, 2026
…octl#338) CodeQL on PR C (rossoctl#137 js/polynomial-redos, rossoctl#138 and rossoctl#139 js/file-access-to-http, relay-release.ts:62/65/67): - The listener's base URL loses its trailing slashes in a loop (releaseUrl), not with /\/+$/, which backtracks on many slashes. - The release URL and bearer now travel as the control plane's other secrets do: configFromEnv reads them into the config (CpConfig.relayRelease, every profile, with the same boot checks), and the request that needs them builds the releaser from deps.config (releaserOf), as the operator inference token reaches its upstream. Before, depsFromEnv built a releaser that closed over values read from withCredentials' merged env, whose dynamic property writes of file data CodeQL counts as tainting every value read from it, the URL included. deps.relayRelease stays as the test seam. A local CodeQL 2.27.5 run (security-extended, as CI) over the control plane reports the three alerts at the previous head and none here. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Rong Chang <[email protected]>
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.
Summary
Makes the (expensive) authoritative E6/E1 SWE-bench sharing run ready and priceable, grounded in live OCP characterization (real solve leaves run 8–12 min, model-dominated; setup ~5s). No async (rejected: replica-bound → breaks the per-request concurrency sweep, shared-worker blast radius). Three driver/harness hardenings + token instrumentation.
1. Sync-path leaf timeout (
lib.sh,e6/e1)Real leaves far exceed the ksvc default 300s request timeout and get killed mid-run (uncapturable). New
set_ksvc_timeout <sec>; the swebench drivers bumptimeoutSecondstoSWEBENCH_LEAF_TIMEOUT(default 1800) in setup;restore_ksvc_envresets to 300.set_ksvc_env/set_scalepreservetimeoutSeconds. Cluster prereq: Knativemax-revision-timeout-seconds≥ that value (document as a pre-run step). Recommended authoritative ladderE6_LADDER="1 2 4 8"(high-C mostly measures the model tier).2. Setup-reliable curve heavy representative (
experiments/src/workload.ts)curveItems()'s heavy representative wasmatplotlib__matplotlib-24177— the only C-ext instance in the heavy bucket — which fails setup in ~19s live, so the heavy curve point was always lost.representative()now skips a C-ext/build-heavy repo denylist (matplotlib / scikit-learn / numpy), yieldingpydata__xarray-2905(live-verified: solves in 365s, 1541-byte patch).sweepItem()unchanged. Bucket label unchanged → tests unaffected.3. Per-leaf token capture (
harness/src/run-leaf.ts,leaf-result-store.ts)Solve
LeafResultnow carries cumulativeusagefromsession.getSessionStats().tokens(input/output/cacheRead/cacheWrite/total), persisted toleaf:resultand returned byGET /runs/status. Drivers record it via a newlib.shappend_usage→usage.jsonl, enabling run cost pricing. Field threading unit-tested.Validation
set_ksvc_timeoutaccepted at 1800;xarray-2905heavy rep solves (365s / 1541 B); earlier chars: light 484s, medium 737s (all solved).bash -n+shellcheckclean;getSessionStats().tokensfield names verified against pi source;leaf-result-storeusage-threading unit tests added. Synthetic E6 path unchanged.Follow-up
Once merged and CI publishes
:latestwith the token capture, a costed pilot (reduced config) measures real tokens/leaf → full-run cost estimate before triggering the authoritative sweep.Assisted-By: Claude Code