Skip to content

test(hotpath): slice coverage tests + CI for sessions/lcm/capture/temporal - #790

Closed
ScriptedAlchemy wants to merge 5 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/hotpath-slice-coverage-7e30
Closed

test(hotpath): slice coverage tests + CI for sessions/lcm/capture/temporal#790
ScriptedAlchemy wants to merge 5 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/hotpath-slice-coverage-7e30

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

What this PR is

Hotpath coverage only for the sessions/LCM/capture/temporal-query slice: tests and CI that prove the slice's hotpath instrumentation is real, feature-gated, and off by default. Benches are deliberately deferred to a later PR (they will be daemon-free when they come). No production code is touched.

Crates touched (tests only, one new tests/hotpath_coverage.rs each)

  • crates/tracedecay-sessions
  • crates/tracedecay-session-memory
  • crates/tracedecay-session-runtime
  • crates/tracedecay-session-temporal-store
  • crates/tracedecay-lcm
  • crates/tracedecay-capture
  • crates/tracedecay-temporal-query

Plus one new workflow: .github/workflows/hotpath-slice-tests.yml. The existing index-bench workflows (hotpath-profile.yml, hotpath-comment.yml) are untouched.

What each crate's hotpath_coverage.rs proves

  1. Off by default (runs in both lanes): the crate manifest's default/production feature arrays never contain hotpath.
  2. Feature-off no-op (cfg(not(feature = "hotpath"))): a real workload runs with HOTPATH_OUTPUT_FORMAT/HOTPATH_OUTPUT_PATH set — no report file is written, and no listener answers on 6770/6771.
  3. Feature-on instrumentation is live (cfg(feature = "hotpath")): a HotpathGuardBuilder guard (JSON report, metrics server off) wraps the same workload, and the report must contain the crate's real measured-site labels — e.g. capture.parse.record, sessions.lcm.scan_base64, sessions.shared.content_storage, usecases.context.session_grant, session_temporal.hydrate.render, temporal.rank, and the async daemon.lcm.execute/daemon.lcm.status futures spans through the mounted LCM authority.

All workloads are deterministic, daemon-free, and socket-free (session-runtime uses the registered global-db test harness on a tempdir). No new fixtures or dependencies were added; no test-only spans were introduced, so no new labels either.

CI

hotpath-slice-tests.yml runs on every PR:

  • cargo test -p <7 slice crates> --locked (feature off)
  • cargo test -p <7 slice crates> --features hotpath --locked (feature on)

with HOTPATH_METRICS_SERVER_OFF=1 at the job boundary. It is additive and does not replace or modify the index-bench profile lane.

Run locally

# feature off
cargo test -p tracedecay-sessions -p tracedecay-session-memory \
  -p tracedecay-session-runtime -p tracedecay-session-temporal-store \
  -p tracedecay-lcm -p tracedecay-capture -p tracedecay-temporal-query --locked

# feature on
cargo test -p tracedecay-sessions -p tracedecay-session-memory \
  -p tracedecay-session-runtime -p tracedecay-session-temporal-store \
  -p tracedecay-lcm -p tracedecay-capture -p tracedecay-temporal-query \
  --features hotpath --locked

Explicit confirmations

  • hotpath / hotpath-alloc / hotpath-cpu / hotpath-mcp remain out of default and every production feature set — and the new tests now enforce that permanently.
  • No existing #[hotpath::measure] (or any other hotpath macro) was added, restamped, rewritten, renamed, or moved. The in-flight measure PRs (HP-sessions, HP-temporal, HP-lcm) are untouched.
  • Workspace stays pinned to hotpath 0.24 (default-features = false, features = ["threads"]); no version bump, no Cargo.toml/Cargo.lock changes.
  • PR feat: TraceDecay V2 delivery (PR8–PR13) + daemon performance, memory, and reliability overhaul #707 is untouched and unmerged; this branch only reads from it as its base.
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 31, 2026 18:13
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
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: 39937e1

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

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Performance Comparison codex/tracedecay-total-redesign-plan-reopenedcursor/hotpath-slice-coverage-7e30

Total Elapsed Time: 5.09s → 5.07s (-0.4%)
CPU Baseline: 87.50µs → 83.63µs (-4.4%)
Benchmark ID: index-bench-timing

timing - Execution duration of functions.

+------------------------------------------+----------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| Function                                 | Calls                      | Avg                            | P95                            | Total                          | % Total                      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| tracedecay-index-bench                   | 1 → 1 (+0.0%)              | 5.09s → 5.07s (-0.4%)          | 5.09s → 5.07s (-0.4%)          | 5.09s → 5.07s (-0.4%)          | 100.00% → 100.00% (+0.0%)    |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| query.artifact.append_pages              | 13 → 13 (+0.0%)            | 178.54ms → 180.27ms (+1.0%)    | 245.24ms → 247.07ms (+0.7%)    | 2.32s → 2.34s (+0.9%)          | 45.63% → 46.26% (+1.4%)      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| query.artifact.batch.sqlite              | 13 → 13 (+0.0%)            | 122.24ms → 123.92ms (+1.4%)    | 168.56ms → 169.08ms (+0.3%)    | 1.59s → 1.61s (+1.3%)          | 31.24% → 31.80% (+1.8%)      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| query.artifact.batch.postings            | 13 → 13 (+0.0%)            | 107.25ms → 108.74ms (+1.4%)    | 149.68ms → 151.13ms (+1.0%)    | 1.39s → 1.41s (+1.4%)          | 27.41% → 27.90% (+1.8%)      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| CodeIndexProductionOwnerV1::extract_file | 276 → 276 (+0.0%)          | 5.19ms → 4.89ms (-5.8%)        | 8.03ms → 7.40ms (-7.8%)        | 1.43s → 1.35s (-5.6%)          | 28.17% → 26.62% (-5.5%)      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| code_index.workers.install               | 83 → 83 (+0.0%)            | 16.11ms → 15.87ms (-1.5%)      | 53.71ms → 53.48ms (-0.4%)      | 1.34s → 1.32s (-1.5%)          | 26.29% → 25.99% (-1.1%)      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| code_index.build.and_publish             | 2 → 2 (+0.0%)              | 533.32ms → 522.08ms (-2.1%)    | 551.55ms → 527.70ms (-4.3%)    | 1.07s → 1.04s (-2.8%)          | 20.97% → 20.61% (-1.7%)      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| domain.canonical.sha256                  | 114526 → 114526 (+0.0%)    | 9.08µs → 8.98µs (-1.1%)        | 15.10µs → 15.13µs (+0.2%)      | 1.04s → 1.03s (-1.0%)          | 20.44% → 20.31% (-0.6%)      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| query.artifact.finalization.advance_wake | 14 → 14 (+0.0%)            | 53.80ms → 53.54ms (-0.5%)      | 264.90ms → 263.06ms (-0.7%)    | 753.20ms → 749.53ms (-0.5%)    | 14.81% → 14.79% (-0.1%)      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| code_index.chunk.index_file              | 276 → 276 (+0.0%)          | 2.37ms → 2.25ms (-5.1%)        | 3.51ms → 3.28ms (-6.6%)        | 654.29ms → 621.67ms (-5.0%)    | 12.86% → 12.27% (-4.6%)      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| query.artifact.prepare_pages             | 13 → 13 (+0.0%)            | 47.45ms → 47.43ms (-0.0%)      | 68.75ms → 68.16ms (-0.9%)      | 616.88ms → 616.54ms (-0.1%)    | 12.13% → 12.17% (+0.3%)      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| code_index.extract.parser_artifact       | 276 → 276 (+0.0%)          | 2.24ms → 2.10ms (-6.2%)        | 4.04ms → 3.18ms (-21.3%) 🚀    | 619.29ms → 578.95ms (-6.5%)    | 12.17% → 11.43% (-6.1%)      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| query.artifact.batch.parallel_prepare    | 13 → 13 (+0.0%)            | 37.15ms → 37.13ms (-0.1%)      | 53.87ms → 53.48ms (-0.7%)      | 482.94ms → 482.69ms (-0.1%)    | 9.49% → 9.53% (+0.4%)        |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| code_index.chunk.build                   | 276 → 276 (+0.0%)          | 1.45ms → 1.38ms (-4.8%)        | 2.11ms → 1.99ms (-5.7%)        | 401.09ms → 381.07ms (-5.0%)    | 7.88% → 7.52% (-4.6%)        |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+
| code_index.chunk.identify                | 276 → 276 (+0.0%)          | 1.44ms → 1.37ms (-4.9%)        | 2.09ms → 1.97ms (-5.7%)        | 396.88ms → 376.78ms (-5.1%)    | 7.80% → 7.44% (-4.6%)        |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+--------------------------------+------------------------------+

Generated with hotpath-rs

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Review of record (integration lane, base 7f1f8e02c).

The feature-on guard-report tests are the valuable part and are accepted as written (subject to every asserted label still existing after 3e26c7596, which removed many spans — verified during integration). Three changes will land as a follow-up commit on the merged head:

  1. Fold the workflow. Origin already carries .github/workflows/hotpath-coverage.yml (storage slice, job slice-tests). This PR adds a second workflow whose job is also named slice-tests, so the PR shows two identically named checks with different results. The seven crates run as a second job sessions-slice-tests inside hotpath-coverage.yml; hotpath-slice-tests.yml is dropped.
  2. Drop hotpath_stays_out_of_default_and_production_features and the hand-rolled manifest_feature_array (duplicated 7×). Scanning Cargo.toml text is a source-shape scan used as acceptance, which the repo rules exclude; the feature-off CI lane building with default features and asserting no report is written is the behavioral check.
  3. Drop the 6770/6771 TcpStream::connect probe. It asserts a property of the host (no other process listening), not of the crate, and false-fails on any machine running a hotpath-enabled daemon — including the dev box this is integrated on.

Red checks here are from a stale-base merge commit; re-judged on the merged #707 head.

ScriptedAlchemy added a commit that referenced this pull request Sep 3, 2026
Squash PR #790's coverage suites and slice workflow onto the current
integration tip.

Merges #790
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Integrated into codex/tracedecay-total-redesign-plan-reopened (#707) by fast-forward push, rebased on 77be8b23c:

  • 622d066a9 test(hotpath): add slice coverage for sessions/lcm/capture/temporal — this PR's seven tests/hotpath_coverage.rs files (trailer Merges #790).
  • 94eac52fe test(hotpath): fold slice coverage into the hotpath-coverage workflow — the review fixes above: the seven crates run as job sessions-slice-tests inside .github/workflows/hotpath-coverage.yml (per-package <crate>/hotpath feature syntax, HOTPATH_METRICS_SERVER_OFF=1); hotpath-slice-tests.yml removed; the Cargo.toml string-scan test and the 6770/6771 port probe dropped from all seven suites.

Evidence on the integrated head (cf8269f80 base, identical patches):

  • every asserted label still has a live production measure after the #774/#775/#776/#778/#779/#784/#786 instrumentation reverts (16 labels checked, e.g. sessions.shared.content_storagecrates/tracedecay-sessions/src/runtime/shared.rs:676, daemon.lcm.executelcm_authority.rs:178, temporal.rankranking.rs:125);
  • feature-off lane: 7 binaries × 1 passed; 0 failed; feature-on lane (--features tracedecay-sessions/hotpath,…): 7 × 1 passed; 0 failed, guard reports carry the labels;
  • cargo fmt --check, clippy --tests -D warnings for the seven crates, workflow YAML parse: pass;
  • MCP suite on the integrated head: 384 passed / 1 failed (context_relevance_eval_test::context_eval_fixture_scores_real_queries, mean_recall_at_5 0.29 < 0.3, unrelated to this slice — retrieval eval on the base; being re-run in isolation).

Closing: the content is on the target branch under the commits above.

BleedingDev pushed a commit to BleedingDev/tracedecay that referenced this pull request Sep 5, 2026
Squash PR ScriptedAlchemy#790's coverage suites and slice workflow onto the current
integration tip.

Merges ScriptedAlchemy#790
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