Skip to content

[Refactor]: Separate conformance TCK SUT from performance diagnostics SUT #239

Closed

Description

@MisterVVP

Context

The current tests/sut/tck_sut.cpp serves two different purposes:

  1. it is the system under test used by the mandatory A2A TCK conformance workflow;
  2. it is also reused by the wire-level performance runner.

PR #223 added performance-oriented instrumentation that is useful for profiling streaming and subscription latency, including HTTP connection diagnostics and optional subscription phase diagnostics.

This works, but it couples the conformance SUT to performance-only behavior. In particular, the TCK SUT can be compiled with A2A_ENABLE_SUBSCRIPTION_DIAGNOSTICS and emits performance diagnostics that the performance runner parses from the SUT log.

The conformance binary should not need to know about performance diagnostics.

Goal

Separate conformance and performance entry points while keeping one shared SUT runtime implementation.

The desired structure is:

  • tck_sut

    • used only for protocol/conformance validation;
    • contains no performance diagnostics;
    • has no dependency on subscription-diagnostics build flags or diagnostic output formats.
  • performance_sut

    • used by wire-level performance tests;
    • uses the same protocol/runtime implementation as tck_sut;
    • owns HTTP/performance counters, subscription diagnostics, and other performance-only instrumentation.

Both binaries should be thin entry points over a shared internal SUT runtime so protocol behavior cannot drift between conformance and performance testing.

Proposed design

Extract the common SUT implementation currently living in tests/sut/tck_sut.cpp into a reusable internal runtime, for example:

tests/sut/
  sut_runtime.h
  sut_runtime.cpp
  tck_sut.cpp
  performance_sut.cpp

SutRuntime should own the common behavior required by both entry points, including:

  • endpoint parsing;
  • REST, JSON-RPC, and gRPC transport setup;
  • agent-card setup;
  • in-memory/PostgreSQL store selection;
  • HTTP listener/socket lifecycle;
  • request routing;
  • connection shutdown;
  • subscription shutdown;
  • deterministic process lifecycle.

Performance-only instrumentation should remain outside the conformance entry point and be enabled only by performance_sut.

The exact file/class names are not mandatory; the important constraint is one shared runtime with two small, purpose-specific binaries.

Scope

1. Extract the shared SUT runtime

Move reusable server setup and lifecycle behavior out of tests/sut/tck_sut.cpp.

Avoid duplicating transport setup, store setup, routes, fixtures, or shutdown behavior between the two executables.

2. Keep tck_sut conformance-only

The tck_sut executable must:

  • retain the current TCK endpoints and protocol behavior;
  • retain in-memory and PostgreSQL support;
  • remain compatible with scripts/run_tck_sut.sh and the mandatory TCK workflow;
  • contain no subscription-performance diagnostics;
  • contain no performance diagnostic output prefixes or counters;
  • not require A2A_ENABLE_SUBSCRIPTION_DIAGNOSTICS.

Where diagnostics such as A2A_HTTP_DIAGNOSTICS exist solely for performance reporting, move them out of tck_sut as well.

3. Add performance_sut

Add a dedicated wire-performance executable that uses the same shared SUT runtime.

It should provide the instrumentation currently required by the performance runner, including as applicable:

  • HTTP connection/reuse diagnostics;
  • finite-stream connection diagnostics;
  • subscription phase diagnostics when A2A_ENABLE_SUBSCRIPTION_DIAGNOSTICS is enabled;
  • performance-specific shutdown reporting.

Performance instrumentation must not alter A2A protocol semantics or benchmark fixtures.

4. Update the performance runner

Update scripts/run_performance_tests.py / related scripts to launch performance_sut for wire scenarios instead of tck_sut.

Prefer introducing a performance-specific executable setting such as A2A_PERF_SUT.

If temporary backward compatibility with A2A_TCK_SUT is useful during migration, keep it explicitly documented and remove it once all callers use the new name.

Do not change benchmark scenarios, request counts, event counts, success criteria, or measured coordinate semantics as part of this refactor.

5. Update build and CI wiring

Update CMake and CI so:

  • tck_sut is built for conformance without performance-diagnostics requirements;
  • performance_sut is built for performance tests;
  • the subscription-diagnostics smoke builds/runs the performance SUT;
  • normal wire performance tests use performance_sut;
  • TCK workflows continue to use tck_sut.

6. Keep report compatibility initially

Do not combine this architectural cleanup with an unnecessary performance-report schema migration.

Existing result fields should remain compatible where practical.

For example, renaming a historical driver_type such as wire_tck_sut to wire_performance_sut can be handled separately unless the change is required for correctness.

Non-goals

  • Changing public SDK APIs.
  • Changing A2A protocol behavior.
  • Changing TCK fixtures or mandatory-category semantics.
  • Changing performance benchmark event counts or success criteria.
  • Optimizing performance as part of the extraction.
  • Maintaining two independently implemented SUTs.

Acceptance criteria

  • tck_sut and performance_sut use one shared internal runtime for common transport/server/store behavior.
  • tck_sut contains no performance-only diagnostic counters, emitters, prefixes, or subscription-diagnostics code.
  • tck_sut does not depend on A2A_ENABLE_SUBSCRIPTION_DIAGNOSTICS.
  • Normal TCK execution remains behaviorally equivalent for REST, JSON-RPC, and gRPC.
  • Mandatory TCK tests pass for both in-memory and PostgreSQL backends with no executed-test failures.
  • performance_sut provides all diagnostics currently required by the normal performance suite and subscription-diagnostics smoke.
  • Existing wire performance scenarios still execute with unchanged fixtures and measurement semantics.
  • Performance reports contain zero operation errors in the standard smoke validation.
  • Tests prevent the two entry points from silently diverging in shared endpoint/runtime configuration.
  • ./scripts/verify_changes.sh passes.
  • ./scripts/run_clang_tidy.sh build passes.
  • Repository-wide clang-format --dry-run --Werror passes.
  • Mandatory performance smoke validation passes.
  • Documentation describing the performance SUT and TCK SUT is updated.

Motivation

The TCK SUT should answer one question: is the SDK/server implementation protocol-conformant?

The performance SUT should answer a different question: how does that same implementation behave under measured wire workloads, and where is time being spent?

Sharing the runtime keeps behavior equivalent while separating those concerns and prevents future performance instrumentation from adding complexity to the conformance fixture.

Activity

  1. converted this from a draft issue on Sep 5, 2026
  2. added
    refactoring
    on Sep 5, 2026
  3. added this to the v0.6.0 milestone on Sep 24, 2026
  4. modified the milestones: v0.6.0, v0.5.1 on Oct 1, 2026
  5. moved this from Todo to In Progress in a2a-cpp SDK Roadmapon Oct 2, 2026
  6. self-assigned this
    on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

refactoring

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions