Skip to content
This repository was archived by the owner on May 4, 2026. It is now read-only.

TCK-00612: FAC gate throughput pivot: host-aware profiles + queue-managed contention + bounded-spec alignment#706

Merged
Anveio merged 3 commits into
mainfrom
ticket/RFC-0019/TCK-00612
Feb 16, 2026
Merged

TCK-00612: FAC gate throughput pivot: host-aware profiles + queue-managed contention + bounded-spec alignment#706
Anveio merged 3 commits into
mainfrom
ticket/RFC-0019/TCK-00612

Conversation

@Anveio

@Anveio Anveio commented Feb 16, 2026

Copy link
Copy Markdown
Collaborator
ticket_meta:
  schema_version: 2026-01-29
  template_version: 2026-01-29
  ticket:
    id: TCK-00612
    title: 'FAC gate throughput pivot: host-aware profiles + queue-managed contention + bounded-spec alignment'
    status: OPEN
  binds:
    prd_id: PRD-PLACEHOLDER
    rfc_id: RFC-0019
    requirements: []
    evidence_artifacts: []
  custody:
    agent_roles:
    - AGENT_IMPLEMENTER
    responsibility_domains:
    - DOMAIN_RUNTIME
    - DOMAIN_SECURITY
    - DOMAIN_DOCUMENTATION
  dependencies:
    tickets:
    - ticket_id: TCK-00410
      reason: Original bounded-runner contract and guardrail semantics; requires amendment to avoid throughput ambiguity.
    - ticket_id: TCK-00436
      reason: Original fac gates unification and bounded-execution assumptions; requires throughput-profile clarification.
    - ticket_id: TCK-00519
      reason: Lane-derived test parallelism introduced; this ticket decouples throughput defaults from lane cpu_quota.
    - ticket_id: TCK-00549
      reason: Bounded executor rewrite semantics retained for containment while throughput defaults are redefined.
    - ticket_id: TCK-00602
      reason: Uniform timeout/memory policy retained; CPU throughput defaults pivot to profile resolution.
    - ticket_id: TCK-00605
      reason: Rust-native bounded test path retained; throughput defaults need explicit profile-based policy.
    - ticket_id: TCK-00607
      reason: Timeout unification retained; throughput assumptions require amendment.
  root_cause_analysis:
    summary: |
      Full FAC gate regressions (>10 minutes) are dominated by bounded test-path
      throttling and cold compile amplification.

      Confirmed contributors:
      1. Default CPU quota of 200% (effectively ~2 cores) on high-core hosts.
      2. Test/build parallelism derived from quota (NEXTEST_TEST_THREADS and
         CARGO_BUILD_JOBS both collapsing to 2 under default policy).
      3. Cold build behavior and cache-warmth variance amplify low parallelism.
      4. Security hardening (wrapper stripping and strict env policy) is
         correct but removed prior acceleration paths, increasing compile cost.

      Baseline evidence:
      - quick gates remain ~120s class.
      - full gates stall in test phase with wide compile fan-in.
      - controlled benchmark showed ~2.1x compile-time delta between jobs=2 and
        jobs=16 for the same filtered workload.
  scope:
    in_scope:
    - Introduce gate throughput profiles (`throughput`, `balanced`, `conservative`) and wire profile selection into `apm2 fac gates`.
    - Default `apm2 fac gates` to `throughput` profile on high-capacity hosts.
    - Decouple test/build parallelism defaults from lane cpu_quota; use host-aware profile-derived parallelism.
    - Retain fail-closed bounded containment controls (timeout, memory, pids, env filtering, systemd isolation).
    - Apply profile-derived defaults to pipeline bounded test command construction to prevent cross-path drift.
    - Emit effective resolved resource settings in gate JSON events and summaries for observability.
    - Amend all impacted TCKs with explicit throughput-pivot notes to remove conflicting bounded-throughput assumptions.
    out_of_scope:
    - Removing bounded execution or containment controls.
    - Reintroducing wrapper/sccache pass-through in bounded mode without new containment guarantees.
    - Global distributed scheduler redesign.
  plan:
    steps:
    - id: STEP_01
      title: Profile model implementation
      detail: |
        Add a gate throughput profile enum and resolver for:
        - effective test parallelism
        - effective CPU quota percent
        Include deterministic host-aware bounds.
    - id: STEP_02
      title: CLI and gates wiring
      detail: |
        Add `--gate-profile` to `apm2 fac gates`.
        Change default `--cpu-quota` handling to `auto` resolution from profile.
        Surface requested/effective settings in JSON telemetry.
    - id: STEP_03
      title: Decouple test env defaults
      detail: |
        Refactor FAC throughput resolution to host-aware behavior and use
        explicit helper(s) for profile-driven parallelism injection.
    - id: STEP_04
      title: Pipeline alignment
      detail: |
        Apply the same profile-driven throughput defaults in pipeline bounded
        test command construction to keep gates and pipeline behavior aligned.
    - id: STEP_05
      title: Ticket amendment sweep
      detail: |
        Add amendment entries to all impacted tickets:
        TCK-00410, TCK-00436, TCK-00519, TCK-00549, TCK-00602,
        TCK-00605, TCK-00607.

        Amendment rule:
        - bounded constraints remain security/containment requirements.
        - default throughput is profile-driven and queue-managed on
          high-capacity hosts.
    - id: STEP_06
      title: Validation
      detail: |
        Run compile and targeted tests for:
        - profile resolution and auto quota behavior
        - host-aware test env behavior
        - gate module integration paths
  definition_of_done:
    evidence_ids: []
    criteria:
    - '`apm2 fac gates --help` exposes `--gate-profile` with throughput/balanced/conservative options.'
    - '`apm2 fac gates` defaults to profile-driven host-aware parallelism and no longer defaults to fixed two-thread behavior.'
    - '`NEXTEST_TEST_THREADS` and `CARGO_BUILD_JOBS` default resolution is decoupled from lane cpu_quota.'
    - Pipeline bounded test command path uses the same throughput-profile defaulting model as local gates.
    - Bounded containment semantics remain fail-closed and unchanged in security posture.
    - Impacted historical tickets include explicit amendment notes documenting the policy pivot.
    - '`cargo check -p apm2-core -p apm2-cli` passes.'
    - Targeted profile/test-env unit tests pass.
  notes:
    context: |
      This ticket formalizes a policy pivot:
      - Keep bounded controls as mandatory safety containment.
      - Move throughput control to host-aware profiles + queue admission.

      This prevents future ambiguity where “bounded” was interpreted as
      “always low throughput,” which caused avoidable gate latency on
      high-capacity hosts.
    security: default-deny, least privilege, fail-closed
fac_push_metadata:
  commit_history:
  - short_sha: 07918e3c
    message: Clarify security reviewer instructions and create TCK.
  - short_sha: 710461b1
    message: 'TCK-00610/TCK-00612: stream gate progress and remove pipeline CPU split'
  - short_sha: 9d643ab5
    message: Restore SHA-binding constraint in security review prompt

FAC Gate Status

# apm2-gate-status:v2
sha: 9d643ab52b5c4451d2b263f22bab6fa8e7a541a6
short_sha: 9d643ab5
timestamp: '2026-02-16T20:16:13Z'
all_passed: true
gates:
  - name: 'merge_conflict_main'
    status: PASS
    duration_secs: 0
  - name: 'rustfmt'
    status: PASS
    duration_secs: 3
  - name: 'clippy'
    status: PASS
    duration_secs: 0
  - name: 'doc'
    status: PASS
    duration_secs: 0
  - name: 'test_safety_guard'
    status: PASS
    duration_secs: 0
  - name: 'test'
    status: PASS
    duration_secs: 41
  - name: 'workspace_integrity'
    status: PASS
    duration_secs: 6
  - name: 'review_artifact_lint'
    status: PASS
    duration_secs: 0

@Anveio Anveio enabled auto-merge February 16, 2026 20:16
@Anveio

Anveio commented Feb 16, 2026

Copy link
Copy Markdown
Collaborator Author
# apm2-review-verdict:v1
schema: apm2.review.verdict.v1
pr: 706
sha: 9d643ab52b5c4451d2b263f22bab6fa8e7a541a6
updated_at: 2026-02-16T20:21:34Z
dimensions:
  code-quality:
    decision: approve
    reason: 'PASS: Throughput profiles correctly implemented, host-aware parallelism verified, and pipeline alignment completed. No blocker or major findings.'
    set_by: ubuntu
    set_at: 2026-02-16T20:21:34Z
  security:
    decision: approve
    reason: 'PASS: no blocker or major findings'
    set_by: ubuntu
    set_at: 2026-02-16T20:19:25Z
findings: []

@Anveio Anveio merged commit c59f64b into main Feb 16, 2026
3 checks passed
@Anveio Anveio deleted the ticket/RFC-0019/TCK-00612 branch February 16, 2026 20:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant