Skip to content

refactor!: unify benchmark execution and count-based recovery v3 - #9

Merged
yyyyyt123 merged 15 commits into
mainfrom
codex/release-image-on-tag
Nov 9, 2026
Merged

yyyyyt123 merged 15 commits into
mainfrom
codex/release-image-on-tag

Conversation

@yyyyyt123

@yyyyyt123 yyyyyt123 commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Benchmark and simulator execution maintained overlapping baseline, observation and recovery logic. This change shares incident execution, verifies the telemetry window used for diagnosis, and adopts one recovery policy with explicit migration for existing campaigns.

Changes

  • Compile fixed Pingmesh probe plans, verify coverage and late-arriving telemetry, and generate fault catalog v2 cases with private effect audits.

  • Share benchmark/simulator lifecycle and recovery implementation. Recovery policy v3 uses resource readback and two rounds of state checks, with full calibration after 10 baseline uses, environment changes or recovery anomalies; baseline age alone no longer triggers calibration. Retained runtimes receive final calibration; runtimes scheduled for immediate destruction verify teardown.

  • Simplify internal topology, traffic, tracing and diagnosis representations while preserving custom agent, fault and evaluator integration.

  • Remove the standalone simulator HTTP service and its CLI/SDK entry points. Session-scoped diagnostic HTTP MCP remains supported, with authentication, cancellation and tool-budget enforcement for the isolated Codex example agent.

  • Preserve the agent observation boundary: injection/audit state stays private. BGP tools now enumerate valid view/format arguments, accept the documented advertised-route aliases, and distinguish safe argument guidance from redacted collection failures.

  • Fix SDK failure isolation: unwrap SDK runtime pools at the internal execution boundary so recovery/final-calibration failures can quarantine the platform pool and persist reports. SDK provisioning/teardown exception mapping, original errors and existing scores are retained. Add ten public-entry regression cases and correct two Black formatting differences.

  • Consolidate duplicate test contracts and setup while retaining failure/isolation coverage. Fix a test monkeypatch that missed the executor's imported capture function and caused three 20-second busy loops; a fail-fast wait guard prevents recurrence.

Compatibility and migration

RecoveryPolicy remains the public SDK name, but recovery configuration must declare version 3 and no longer accepts baseline_max_age_seconds, mode or the old fixed recovery wait. Version 2 and older execution configurations are rejected before deployment rather than silently reinterpreted. Migrate explicitly into a new directory:

netopsbench scenario migrate SOURCE --out NEW_DIRECTORY

The migration preserves testcase IDs and fault parameters, records provenance, and creates new campaign identities. Historical reports remain readable. The removed standalone simulator service is distinct from diagnostic HTTP MCP.

Validation

  • Full local Python offline regression: 1302 passed, 8 real-environment tests deselected (267.48 seconds). Includes the installed-wheel resource/import contract; real Containerlab tests were excluded.
  • Ruff, Black, configured Mypy checks (85 source files), and git diff --check passed.
  • Documentation production build passed for the documentation tree in this PR.
  • The new SDK regression reproduced the original missing-mark_quarantined error before the fix. It covers single/suite entry points, cleanup/calibration failures, retained/destroyed runtimes, report/score preservation, and public provisioning/teardown error types.
  • Recovery v3 regressions cover benchmark/simulator reuse after two hours without changing baseline timestamps, the tenth/eleventh consumption boundary, environment changes, failed recovery, and non-destructive migration with new campaign identity. Five isolated deliberate faults were detected by retained tests during test consolidation (residual recovery, then-v2 expiry, SDK quarantine, private evidence and negative-sample scoring); v3 deliberately replaces the old expiry requirement.
  • Rust format/Clippy/tests, the native client image build and Python 3.13 remain subject to PR CI. Local Rust checking was unavailable because the installed toolchain image lacks the required components.

Validation limits

Recorded isolated runtime acceptance and migration details are in docs/content/docs/architecture/recovery-v2-audit.mdx and runtime-audit.mdx. They are not a claim that every large-scale case has passed. Current xlarge/k=12 experiments use frozen commit 5c6a9cd; they have encountered host-memory interruptions, recovery/collection timeouts, unobserved fault effects and tool-budget failures. The SDK isolation fix and recovery v3 are covered offline; recovery v3 has not yet had an isolated real-lab shadow-window or performance comparison. Historical v1/v2 acceptance does not validate v3. Per-case recovery checks are preserved, but full data-plane evidence may be older without the age limit. Running experiments and their frozen sources/configuration were not modified. Device-down residual-rejection coverage remains incomplete as documented.

Experiment artifacts, credentials, local resume drivers and presentations/ are excluded from this PR.

Compile immutable peer, port and frame schedules with candidate-path coverage
witnesses. Execute the same plan in Rust and scope observations to its plan ID.
Use shared client addressing, consecutive Fat-tree ASNs and current-only v4/v2
formats. Add K18's 405 switches, 324 clients and generated fault campaigns.

Validation: 777 lightweight tests in a clean tree; 28 Rust tests, locked Clippy
and cargo fmt checks. Plan audits cover every directed link for all scales.
Use the pinned Containerlab build and owned management-network controller.
Restore SONiC node state after stop/start and share one health deadline across
processes, readiness probes, query queues, HTTP responses and retries.
Cancel deployment by terminating and reaping its owned process group; persist
quarantine state through one idempotent runtime method.

Validation: 850 lightweight tests in a clean tree plus 34 deadline/query/health
tests after the final streaming fix. Privileged process cancellation, XS node
stop/start and final full health passed. Ruff, Black and Mypy passed.
Run pinned codex exec with shared diagnosis schemas and the existing SDK agent
contract. Serve episode-scoped MCP tools through the existing registry with
case tokens, validation, budgets and tracing. Isolate shell/Python execution
in per-case containers with restricted credentials and network egress.
Await container startup before cancellation cleanup, verify resource deletion,
and propagate execution failures without scoring synthetic conclusions.

Validation: 875 lightweight tests in a clean tree, Codex event/budget/cancellation
and deletion-failure tests, a real container isolation test, and real XS healthy,
link-down and device-down diagnoses. Ruff, Black and Mypy passed.
Move campaign identity, checkpoints and retention policy into the internal
session module and keep capacity sampling in the runtime resource module.
Monitor the memory floor before deployment and reject changed cases, content,
profiles, plans, images or agent configuration before resume side effects.
Reuse the suite executor, validated manifest and detector while requerying
baseline windows. Preserve recovery checks, agent transitions and final health;
remove duplicated warm checks and legacy checkpoint migration.

Validation: 932 lightweight tests in a clean tree; coverage gate passed at
81.60%, Ruff/Black/Mypy and wheel imports passed. A real XS SIGTERM during a
link fault recovered and retained its lab, then resumed without redeployment.
Codex completed healthy, link-down and device-down cases; final health passed
and all owned lab/diagnostic resources were released. Historical results are
unchanged, and K18 was audited offline rather than redeployed.
Use the official 0.77.0 release and sequential SONiC startup. Remove the performance fork, management/DNS controller and parallel startup helper; bind runtime identity and capacity samples to the actual backend.

Validation: 63 focused tests and Ruff passed in a clean index export. No Docker daemon or global tool changes.
Add 24 scored fault types and 27 mechanisms, deterministic coverage units, shared effects/recovery evidence and minimal diagnostic tool extensions. Remove retired fault implementations and small; mark XS as validation and default public examples to medium.

Freeze per-scale experiment timing, bound agent work and recovery, verify closed-window ingestion from existing probe cycles, and bind baseline handoffs to verified runtime identity. Preserve scoring, Pingmesh window priority and leaf-pair hotspots.

Validation: 273 focused tests and Ruff passed in a clean index export. Existing real effects evidence remains archived without rescoring.
Keep only manifest and neighbor facts required by candidate placement. Share one FRR BGP configuration parser between offline generation and live injection; remove unused interface classifiers, policy naming and implicit target selection.

Use explicit checkpoint completion state instead of reopening archived raw results. Preserve completed zero-score diagnoses and require effects recovery; align baseline scope types and correct default-agent/headroom documentation.

Validation: 1094 lightweight tests passed; clean export passed 256 focused/e2e tests plus all 5 generated-scenario tests after preparing assets. Ruff and diff checks passed. All 520 scenario YAML files and seven coverage matrices remain byte-identical across cleanup.
Align four files with Black, annotate probe evidence and exception metadata, propagate optional baseline duration through worker helpers, narrow the recovery snapshot branch, and validate the archive read handle.

Validation: 204 focused tests, Ruff, Black, Mypy (86 source files), and diff checks passed.
Generate XS and medium assets before regression tests to match the public example defaults. Check missing and incorrect MCP tokens through HTTP 401 responses, independent of client exception wording, while preserving gateway and budget assertions.

Validation: 58 Codex/example tests passed in both the working checkout and a clean index export after the CI asset-preparation command. Ruff, Black and diff checks passed.
…ecution

Keep simulator and benchmark execution on the shared incident lifecycle,
isolate private injection evidence, and fix recovery and lease handling.
Consolidate canonical topology access, case initialization, diagnosis and
trace processing, BGP event output, and runtime cleanup.

Remove the standalone simulator HTTP service and legacy internal branches.
Preserve diagnostic MCP and public extension contracts; document removed
interfaces, changed defaults, fault evidence limits, and migration steps.
Include regression tests, runtime validation tooling, and both audit reports.

Validation: 1252 offline tests passed; 8 real tests deselected. Dedicated
XS (5 cases) and medium (7 cases) acceptance passed with cleanup verified.
5832 old/new BGP outputs matched. Ruff, configured mypy, clean-wheel
contracts, and diff checks passed.
Verify restored resources and stable network state per case, reuse bounded healthy baselines, and calibrate periodically and at run completion. Preserve full-window compatibility and document validation results and limits.
Remove legacy recovery modes and single-use baseline paths. Use bounded 10-case/600-second reuse, calibrate retained runtimes, and skip final calibration only before owned-runtime destruction.

Add explicit non-destructive scenario migration, preserve interruption cleanup, and document correctness and performance validation. Verified with 1282 offline tests, static checks, wheel contracts, real recovery/shadow audits, and 60 performance cases.
Unwrap SDK runtime pools only at the internal execution boundary while retaining public provisioning and teardown exception mapping. Cover cleanup and calibration failures through the public SDK and align existing Black formatting.
@yyyyyt123 yyyyyt123 changed the title refactor!: unify benchmark execution and recovery v2 refactor!: unify benchmark execution and count-based recovery v3 Nov 8, 2026
@yyyyyt123
yyyyyt123 merged commit 6691406 into main Nov 9, 2026
6 of 8 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