Skip to content

feat(hotpath): fill code-index parse/index gaps - #784

Merged
ScriptedAlchemy merged 4 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/hotpath-code-index-gaps-c42d
Sep 3, 2026
Merged

feat(hotpath): fill code-index parse/index gaps#784
ScriptedAlchemy merged 4 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/hotpath-code-index-gaps-c42d

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

Fills the remaining hotpath coverage gaps in crates/tracedecay-code-index (HP-index) only. Adds 27 #[hotpath::measure] attributes across 13 previously zero-coverage production source files, targeting leftover parse/index/join paths. All macros compile to no-ops without the opt-in hotpath feature; nothing is enabled in default or production builds, and no Cargo.toml features were touched.

New measures (code_index.<area>.<verb>)

Area Labels Files
languages build_registry, index_descriptors languages.rs
capability compute_seal, emit, validate capabilities.rs
joins impact.join, test_attribution.join, test_attribution.digest_evidence, diagnostics.join impact_join.rs, test_attribution.rs, diagnostics.rs
lineage index_symbols, resolve lineage.rs
receipts digest_request, build_batch, verify_batch receipts.rs
git_topology build_manifest, open, traverse, collect_ancestors, read_stack_revision, read_worktree_occupancy git_projection.rs, git_projection/declared_topology.rs
graph scan_import_candidates graph_projection/interactive/imports.rs
artifact assemble, verify_imports chunks/artifacts.rs
production ignored_sources.admit, ignored_sources.restore, imports.derive, imports.validate production/ignored_sources.rs, production/import_evidence.rs

Intentionally skipped

  • graph_projection/traversal.rs, graph_projection/schema.rs, graph_projection/interactive/models.rs — per-node/per-entity helpers inside tight loops; the crate's hotpath_observe doctrine forbids per-node measurement (file-operation granularity only).
  • provider.rs (trait definitions plus cheap envelope validators) and production/generation_attribution.rs (getter-shaped stale-read shim) — getter-class code, skipped per instructions.
  • Tests, Display impls, and getters throughout.
  • Benches (code_index_chunks / retained_parse) are deliberately not wired here — deferred to the separate coverage PR.

Out-of-scope note

cargo clippy --all-targets -- -D warnings fails in the dependency crate tracedecay-graph-db (too_many_arguments on stage_generation_pages in generation_runtime.rs); that pre-exists on the base branch and is untouched by this PR.

Verification

  • cargo check -p tracedecay-code-index — pass
  • cargo check -p tracedecay-code-index --features hotpath — pass
  • cargo clippy -p tracedecay-code-index --all-targets --no-deps -- -D warnings — clean (both with and without --features hotpath)
  • cargo test -p tracedecay-code-index — 345 passed, 0 failed (all targets, default features)
  • cargo test -p tracedecay-code-index --features hotpath --lib — 190 passed, 0 failed
  • npm run lint:commit — pass
Open in Web Open in Cursor 

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: e47890e

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 Sep 1, 2026

Copy link
Copy Markdown
Contributor

Performance Comparison codex/tracedecay-total-redesign-plan-reopenedcursor/hotpath-code-index-gaps-c42d

Total Elapsed Time: 5.50s → 5.12s (-7.0%)
CPU Baseline: 90.00µs → 90.43µs (+0.5%)
Benchmark ID: index-bench-timing

timing - Execution duration of functions.

+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| Function                                 | Calls                      | Avg                             | P95                             | Total                           | % Total                      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| tracedecay-index-bench                   | 1 → 1 (+0.0%)              | 5.50s → 5.12s (-6.9%)           | 5.51s → 5.12s (-7.1%)           | 5.50s → 5.12s (-6.9%)           | 100.00% → 100.00% (+0.0%)    |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.append_pages              | 13 → 13 (+0.0%)            | 199.91ms → 184.38ms (-7.8%)     | 272.89ms → 270.53ms (-0.9%)     | 2.60s → 2.40s (-7.7%)           | 47.22% → 46.83% (-0.8%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.batch.sqlite              | 13 → 13 (+0.0%)            | 126.00ms → 122.50ms (-2.8%)     | 169.61ms → 171.97ms (+1.4%)     | 1.64s → 1.59s (-3.0%)           | 29.77% → 31.12% (+4.5%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.batch.postings            | 13 → 13 (+0.0%)            | 109.78ms → 106.77ms (-2.7%)     | 148.90ms → 151.52ms (+1.8%)     | 1.43s → 1.39s (-2.8%)           | 25.93% → 27.12% (+4.6%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.workers.install               | 83 → 83 (+0.0%)            | 18.11ms → 15.63ms (-13.7%)      | 72.81ms → 52.13ms (-28.4%) 🚀   | 1.50s → 1.30s (-13.3%)          | 27.32% → 25.34% (-7.2%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| CodeIndexProductionOwnerV1::extract_file | 276 → 276 (+0.0%)          | 4.65ms → 4.48ms (-3.7%)         | 6.94ms → 6.74ms (-2.9%)         | 1.28s → 1.24s (-3.1%)           | 23.32% → 24.14% (+3.5%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.build.and_publish             | 2 → 2 (+0.0%)              | 514.94ms → 496.82ms (-3.5%)     | 516.42ms → 497.29ms (-3.7%)     | 1.03s → 993.65ms (-3.5%)        | 18.71% → 19.41% (+3.7%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| domain.canonical.sha256                  | 114526 → 114526 (+0.0%)    | 8.63µs → 8.43µs (-2.3%)         | 13.95µs → 13.81µs (-1.0%)       | 988.63ms → 965.36ms (-2.4%)     | 17.96% → 18.86% (+5.0%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.finalization.advance_wake | 14 → 14 (+0.0%)            | 59.07ms → 54.63ms (-7.5%)       | 286.26ms → 267.39ms (-6.6%)     | 826.98ms → 764.86ms (-7.5%)     | 15.03% → 14.94% (-0.6%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.prepare_pages             | 13 → 13 (+0.0%)            | 62.29ms → 52.01ms (-16.5%)      | 91.55ms → 85.52ms (-6.6%)       | 809.82ms → 676.12ms (-16.5%)    | 14.72% → 13.21% (-10.3%)     |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.chunk.index_file              | 276 → 276 (+0.0%)          | 2.23ms → 2.08ms (-6.7%)         | 3.08ms → 3.02ms (-1.9%)         | 616.21ms → 572.99ms (-7.0%)     | 11.20% → 11.20% (+0.0%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| query.artifact.batch.parallel_prepare    | 13 → 13 (+0.0%)            | 50.79ms → 41.36ms (-18.6%)      | 73.86ms → 71.89ms (-2.7%)       | 660.27ms → 537.64ms (-18.6%)    | 12.00% → 10.50% (-12.5%)     |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.extract.parser_artifact       | 276 → 276 (+0.0%)          | 1.89ms → 1.89ms (+0.0%)         | 2.81ms → 2.83ms (+0.7%)         | 521.79ms → 522.16ms (+0.1%)     | 9.48% → 10.20% (+7.6%)       |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| code_index.build.assemble                | 2 → 2 (+0.0%)              | 193.21ms → 185.01ms (-4.2%)     | 203.42ms → 197.26ms (-3.0%)     | 386.41ms → 370.01ms (-4.2%)     | 7.02% → 7.23% (+3.0%)        |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| 🆕 code_index.chunk.build                | 0 → 276 (+100.0%) ⚠️       | 0.00ns → 1.24ms (+100.0%) ⚠️    | 0.00ns → 1.82ms (+100.0%) ⚠️    | 0.00ns → 343.20ms (+100.0%) ⚠️  | 0.00% → 6.71% (+100.0%) ⚠️   |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+
| 🗑️ code_index.chunk.map_ordered          | 780 → 0 (-100.0%) 🚀       | 448.90µs → 0.00ns (-100.0%) 🚀  | 564.74µs → 0.00ns (-100.0%) 🚀  | 350.14ms → 0.00ns (-100.0%) 🚀  | 6.36% → 0.00% (-100.0%) 🚀   |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+---------------------------------+------------------------------+

Generated with hotpath-rs

@ScriptedAlchemy
ScriptedAlchemy merged commit 3ba9af6 into codex/tracedecay-total-redesign-plan-reopened Sep 3, 2026
10 of 18 checks passed
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Merged into PR #707's integration branch at 3ba9af6da1b13d0488afcdbf695ac348caa5eda7. Validation: the 196-test code-index library suite passed serially after the parallel runner deadlocked, and both hotpath compilation and the direct feature-off gate passed.

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Corrective follow-up: the instrumentation from this PR was reverted in 4fc1f06745e83daba4071ec0956b6e49f95c3d41.

The deep audit found that four labels have no production callers, several labels duplicate centralized spans, and the published profile proves none of the 27 added labels. Focused labels may return only with matched runtime evidence showing that each proposed measurement corresponds to observed production cost.

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