Skip to content

test(usecases): hotpath coverage on work_rollup and semantic_vector_commit_scale - #791

Open
ScriptedAlchemy wants to merge 4 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/hotpath-serving-slice-tests-862f
Open

test(usecases): hotpath coverage on work_rollup and semantic_vector_commit_scale#791
ScriptedAlchemy wants to merge 4 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/hotpath-serving-slice-tests-862f

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

Coverage-only PR for crates/tracedecay-usecases benches work_rollup and semantic_vector_commit_scale. Adds a shared benches/hotpath_coverage.rs helper so both binaries self-check:

  • feature off: hotpath macros are no-ops; no report file; no listener on 6770/6771 even if HOTPATH_OUTPUT_PATH is set.
  • feature on: metrics server forced off (HOTPATH_METRICS_SERVER_OFF); guard drop emits a JSON report. work_rollup then asserts the static usecases.observability.read_model label. semantic_vector_commit_scale drives the uninstrumented in-memory VectorGenerationStateMachineV1, so it verifies the guard lifecycle only (labels_verified=0 is expected, not a fake assertion).

Does not expand .github/workflows/hotpath-profile.yml. Does not restamp existing #[hotpath::measure]. Does not enable hotpath in default/production. Does not merge #707. Diff is the three usecases bench files only.

Verification

  • cargo build -p tracedecay-usecases --benches and both binaries run feature-off (no report, no 6770/6771 listener).
  • cargo build -p tracedecay-usecases --benches --features hotpath (cold, ~8 min).
  • Feature-on semantic_vector_commit_scale completes (labels_verified=0, report_bytes=622, scratch report cleaned up).
  • Feature-on work_rollup hung twice in the cloud agent VM (once ~3.5 min spawn abort, once ~29 min timeout). Not used as a CI gate here. Worth a local rerun with HOTPATH_METRICS_SERVER_OFF=1 and TRACEDECAY_DATA_DIR pointed at a fresh dir.

Test plan

  • cargo build -p tracedecay-usecases --benches
  • cargo build -p tracedecay-usecases --benches --features hotpath
  • Run the two bench binaries feature-off, then feature-on with HOTPATH_METRICS_SERVER_OFF=1.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ce68aef

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T19:09:21.159356Z 75de232 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 75de232724

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +280 to +284
let read_model = tracedecay_usecases::observability::observatory_read_model(
database.as_ref(),
None,
0,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require coverage from the measured work-rollup journey

In self-verifying runs, this post-measurement observatory_read_model call is the only source of the required label; the actual run_work_rollup_case and settled workload in observability_runtime_contract.rs use execution_topology_rollup_metrics instead. The check can therefore pass even when the measured work-rollup journey records no Hotpath samples at all. Require a label emitted by the real benchmark path rather than synthesizing an unrelated read solely for coverage.

AGENTS.md reference: AGENTS.md:L152-L160

Useful? React with 👍 / 👎.

// the macros are no-ops and no report may appear; feature on, the guard
// lifecycle completes with the metrics server forced off and a parseable
// exit report. Extend this list when the machine itself gains labels.
const EXPECTED_HOTPATH_LABELS: &[&str] = &[];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Record a workload label in the semantic coverage run

Because this expected-label slice is empty, finish only verifies that dropping the guard produced syntactically valid JSON; it succeeds even if the semantic commit workload records zero spans or gauges. This makes the advertised coverage unable to detect missing or broken instrumentation. Add a bounded Hotpath measurement around the actual commit sweep and require its exact label, or stop presenting this run as semantic workload coverage.

AGENTS.md reference: AGENTS.md:L152-L160

Useful? React with 👍 / 👎.

Comment on lines +141 to +142
let prior = std::fs::read(&path).ok();
(path, prior)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep existing reports out of peak-memory measurements

When a feature-off baseline inherits a HOTPATH_OUTPUT_PATH that already contains a report, this reads the entire file into a Vec<u8> retained by coverage until after the final VmHWM sample. Since semantic_vector_commit_scale measures process-wide peak memory and states that every retained byte belongs to the subject, a large prior profile directly inflates and corrupts the result. Compare the file without retaining its contents for the lifetime of the workload.

AGENTS.md reference: AGENTS.md:L196-L198

Useful? React with 👍 / 👎.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Performance Comparison codex/tracedecay-total-redesign-plan-reopenedcursor/hotpath-serving-slice-tests-862f

Total Elapsed Time: 4.96s → 4.73s (-4.6%)
CPU Baseline: 252.84µs → 252.90µs (+0.0%)
Benchmark ID: index-bench-timing

timing - Execution duration of functions.

+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| Function                                 | Calls                      | Avg                             | P95                             | Total                           | % Total                      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| tracedecay-index-bench                   | 1 → 1 (+0.0%)              | 4.96s → 4.73s (-4.6%)           | 4.96s → 4.73s (-4.6%)           | 4.96s → 4.73s (-4.6%)           | 100.00% → 100.00% (+0.0%)    |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.append_pages              | 13 → 13 (+0.0%)            | 164.34ms → 167.09ms (+1.7%)     | 224.40ms → 243.14ms (+8.4%)     | 2.14s → 2.17s (+1.4%)           | 43.06% → 45.92% (+6.6%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| CodeIndexProductionOwnerV1::extract_file | 276 → 276 (+0.0%)          | 5.56ms → 5.25ms (-5.6%)         | 12.25ms → 7.41ms (-39.5%) 🚀    | 1.54s → 1.45s (-5.8%)           | 30.95% → 30.63% (-1.0%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.workers.install               | 83 → 83 (+0.0%)            | 19.26ms → 16.91ms (-12.2%)      | 60.88ms → 57.97ms (-4.8%)       | 1.60s → 1.40s (-12.5%)          | 32.21% → 29.67% (-7.9%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.batch.sqlite              | 13 → 13 (+0.0%)            | 104.11ms → 103.09ms (-1.0%)     | 143.39ms → 144.70ms (+0.9%)     | 1.35s → 1.34s (-0.7%)           | 27.28% → 28.33% (+3.8%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.batch.postings            | 13 → 13 (+0.0%)            | 92.12ms → 90.87ms (-1.4%)       | 128.19ms → 129.30ms (+0.9%)     | 1.20s → 1.18s (-1.7%)           | 24.14% → 24.97% (+3.4%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| domain.canonical.sha256                  | 114526 → 114526 (+0.0%)    | 11.35µs → 9.40µs (-17.2%)       | 16.13µs → 16.07µs (-0.4%)       | 1.30s → 1.08s (-16.9%)          | 26.21% → 22.76% (-13.2%)     |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.build.and_publish             | 2 → 2 (+0.0%)              | 584.43ms → 504.70ms (-13.6%)    | 589.30ms → 518.52ms (-12.0%)    | 1.17s → 1.01s (-13.7%)          | 23.56% → 21.34% (-9.4%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.chunk.index_file              | 276 → 276 (+0.0%)          | 2.62ms → 2.76ms (+5.3%)         | 5.74ms → 3.32ms (-42.2%) 🚀     | 722.89ms → 762.45ms (+5.5%)     | 14.57% → 16.12% (+10.6%)     |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.prepare_pages             | 13 → 13 (+0.0%)            | 52.20ms → 55.72ms (+6.7%)       | 71.57ms → 91.42ms (+27.7%) ⚠️   | 678.59ms → 724.41ms (+6.8%)     | 13.68% → 15.31% (+11.9%)     |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.finalization.advance_wake | 14 → 14 (+0.0%)            | 46.21ms → 47.04ms (+1.8%)       | 222.04ms → 223.87ms (+0.8%)     | 646.94ms → 658.59ms (+1.8%)     | 13.04% → 13.92% (+6.7%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.batch.parallel_prepare    | 13 → 13 (+0.0%)            | 42.83ms → 46.04ms (+7.5%)       | 60.88ms → 75.50ms (+24.0%) ⚠️   | 556.81ms → 598.49ms (+7.5%)     | 11.22% → 12.65% (+12.7%)     |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.extract.parser_artifact       | 276 → 276 (+0.0%)          | 2.42ms → 2.01ms (-16.9%)        | 5.57ms → 3.03ms (-45.6%) 🚀     | 666.63ms → 554.43ms (-16.8%)    | 13.44% → 11.72% (-12.8%)     |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| 🆕 code_index.chunk.map_ordered          | 0 → 780 (+100.0%) ⚠️       | 0.00ns → 671.24µs (+100.0%) ⚠️  | 0.00ns → 631.29µs (+100.0%) ⚠️  | 0.00ns → 523.56ms (+100.0%) ⚠️  | 0.00% → 11.07% (+100.0%) ⚠️  |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.chunk.build                   | 276 → 276 (+0.0%)          | 1.62ms → 1.36ms (-16.0%)        | 4.36ms → 1.98ms (-54.6%) 🚀     | 446.56ms → 374.09ms (-16.2%)    | 9.00% → 7.91% (-12.1%)       |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| 🗑️ code_index.chunk.identify             | 276 → 0 (-100.0%) 🚀       | 1.60ms → 0.00ns (-100.0%) 🚀    | 4.35ms → 0.00ns (-100.0%) 🚀    | 442.00ms → 0.00ns (-100.0%) 🚀  | 8.91% → 0.00% (-100.0%) 🚀   |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+

Generated with hotpath-rs

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.

2 participants