Skip to content

perf(test): consolidate agent runtime contract targets - #2001

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/agent-runtime-test-targets-pr13
Aug 3, 2026
Merged

perf(test): consolidate agent runtime contract targets#2001
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/agent-runtime-test-targets-pr13

Conversation

@limityan

@limityan limityan commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • consolidate 27 cross-platform bitfun-agent-runtime integration-test crates into four responsibility-aligned targets
  • keep the Unix-only native process/timeout suite as a fifth independent target so platform and process isolation is preserved
  • disable Cargo autotest discovery and extend the existing core-boundary checker to reject unregistered roots, orphan leaves, duplicate references, and non-flat grouped roots
  • document the target ownership and focused-test command without changing production code, dependencies, features, Cargo.lock, workflows, or CI coverage

Why

The package previously linked 28 integration-test executables against the same feature-free runtime dependency closure. Most of those crates represented source-file granularity rather than an architectural or execution boundary. The new layout preserves the one real platform/process boundary while reducing redundant test compilation and debug artifacts.

Behavior and architecture

  • all 27 moved test sources are byte-identical renames; native_hook_execution_contracts.rs remains at its original path and unchanged
  • Windows preserves 224 integration tests and 280 lib tests; the normalized pre/post integration-test list is identical (a03b977a31db21c247db636d85f60250666a979a57c2b186a0a0ef8129eabde2)
  • Unix keeps the additional 22 native process tests in their own executable (246 integration tests total)
  • grouped roots are intentionally flat indexes; the existing boundary check makes autotests = false fail closed when a future test file is not registered

Local performance observation

Windows 10.0.19045, i7-10700, rustc/cargo 1.97.1, dependencies warmed, A/B/A/B/A/B order. Each sample ran:

cargo clean -p bitfun-agent-runtime

cargo test -p bitfun-agent-runtime --no-run --locked --quiet

Layout Samples Median Integration PDBs
28 targets 12.48s / 15.01s / 13.63s 13.63s 312.3 MiB
5 targets 11.90s / 11.04s / 11.31s 11.31s 77.4 MiB

This is a local observation: median package test compile/link time decreased by about 17.0%, and integration PDB size by about 75.2%. It does not claim fewer third-party dependencies or features.

Validation

  • pnpm run fmt:rs
  • cargo test -p bitfun-agent-runtime --locked --tests (504/504 on Windows; repeated three times before rebase and rerun after rebase)
  • each grouped target and the normalized test-list equivalence check
  • cargo check -p bitfun-agent-runtime --tests --target x86_64-unknown-linux-gnu --locked
  • pnpm run check:core-boundaries:test (40/40)
  • pnpm run check:core-boundaries
  • cargo check -p bitfun-core --features product-full --locked
  • two independent adversarial review rounds plus a final parser-bypass review: no remaining P0-P3 findings

The Windows host cannot execute the 22 Unix shell/process tests; existing Linux CI remains the runtime proof for that path.

@limityan
limityan merged commit 2bb095d into GCWing:main Aug 3, 2026
13 of 14 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