Skip to content

feat(hotpath): fill lcm schema/gc/describe gaps - #779

Draft
ScriptedAlchemy wants to merge 4 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/hotpath-lcm-gaps-710c
Draft

feat(hotpath): fill lcm schema/gc/describe gaps#779
ScriptedAlchemy wants to merge 4 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/hotpath-lcm-gaps-710c

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

Fills the remaining hotpath coverage gaps in crates/tracedecay-lcm only (HP-lcm). Adds 25 #[hotpath::measure] attributes across the previously uninstrumented files — 21 async spans (future = true) plus 4 sync filesystem/CPU spans. No other crates touched, no Cargo.toml changes, no tokio_runtime! introduced, and hotpath stays opt-in (attributes are no-ops without the hotpath feature, exactly like the crate's existing instrumentation).

Labels follow the crate's established sessions.lcm.<area>.<verb> convention so new spans group with the existing ones (e.g. alongside sessions.lcm.gc.preview / sessions.lcm.gc.apply); the user-specified lcm.<area>.<verb> shape is preserved as the meaningful suffix.

Instrumented functions

schema.rsrequire_admissible_lcm_schema (schema.admit), ensure_lcm_schema_in_transaction (schema.ensure — the production schema owner; ensure_lcm_schema itself is #[cfg(test)]-only and skipped per the no-tests rule), raw_fts_structure_is_current (schema.verify_raw_fts), rebuild_raw_fts (schema.rebuild_raw_fts), load_raw_message (raw.load_message).

query/describe.rsraw_message_overviews, summary_overviews, describe_summary_node, describe_summary_sources, describe_external_payload under sessions.lcm.describe.*.

gc/pending_delete.rsstage_payload_delete (gc.stage_delete), drain_pending_payload_deletes_matching (gc.drain_pending_deletes — single measure point shared by both public drain wrappers), probe_metadata_rows (gc.probe_pending_metadata).

gc/placeholder_scan.rsscan_placeholder_text_rows (gc.placeholder_scan), any_placeholder_text_row (gc.placeholder_probe), count_placeholder_text_rows (gc.placeholder_count).

gc/orphan_scan.rspreview_orphan_files (gc.orphan_preview, sync fs scan), stage_orphan_files (gc.orphan_stage).

payload/delete_recovery.rsdelete_external_payload_in_transaction (payload.delete), prepare_external_payload_delete_in_transaction_with_cache (payload.delete_prepare), tombstone_residual_placeholders (payload.tombstone_placeholders), plus sync fs spans remove_committed_payload_file_with (payload.remove_file) and payload_file_fingerprint (payload.fingerprint).

maintenance.rsbackup_database (maintenance.backup), payload_metadata_refs (maintenance.scan_payload_refs — shared by both public ref-collection wrappers).

Skipped per instructions: tests/#[cfg(test)] helpers, trivial single-row accessors (get_gc_meta/set_gc_meta/clear_gc_meta, schema_version), and private probes already covered by their instrumented callers.

Verification

  • cargo check -p tracedecay-lcm (default features): pass
  • cargo check -p tracedecay-lcm --features hotpath: pass
  • cargo clippy -p tracedecay-lcm --all-targets --features hotpath: clean (one pre-existing warning in untouched tracedecay-graph-db)
  • cargo test -p tracedecay-lcm: 162 passed, 0 failed, 1 ignored across 5 suites
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: 79e75af

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-lcm-gaps-710c

Total Elapsed Time: 5.40s → 5.03s (-7.0%)
CPU Baseline: 90.36µs → 90.39µ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%)              | 5.40s → 5.03s (-6.9%)          | 5.41s → 5.03s (-7.0%)          | 5.40s → 5.03s (-6.9%)            | 100.00% → 100.00% (+0.0%)    |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+----------------------------------+------------------------------+
| query.artifact.append_pages              | 13 → 13 (+0.0%)            | 194.77ms → 178.15ms (-8.5%)    | 268.70ms → 242.75ms (-9.7%)    | 2.53s → 2.32s (-8.3%)            | 46.86% → 46.08% (-1.7%)      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.sqlite              | 13 → 13 (+0.0%)            | 123.47ms → 121.46ms (-1.6%)    | 167.38ms → 165.54ms (-1.1%)    | 1.61s → 1.58s (-1.9%)            | 29.71% → 31.42% (+5.8%)      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.postings            | 13 → 13 (+0.0%)            | 108.24ms → 106.50ms (-1.6%)    | 147.19ms → 146.01ms (-0.8%)    | 1.41s → 1.38s (-2.1%)            | 26.04% → 27.55% (+5.8%)      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+----------------------------------+------------------------------+
| code_index.workers.install               | 83 → 83 (+0.0%)            | 18.37ms → 15.10ms (-17.8%)     | 73.53ms → 50.99ms (-30.7%) 🚀  | 1.53s → 1.25s (-18.3%)           | 28.23% → 24.93% (-11.7%)     |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+----------------------------------+------------------------------+
| CodeIndexProductionOwnerV1::extract_file | 276 → 276 (+0.0%)          | 4.45ms → 4.51ms (+1.3%)        | 6.86ms → 6.82ms (-0.6%)        | 1.23s → 1.25s (+1.6%)            | 22.76% → 24.78% (+8.9%)      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+----------------------------------+------------------------------+
| code_index.build.and_publish             | 2 → 2 (+0.0%)              | 514.85ms → 506.25ms (-1.7%)    | 521.93ms → 508.30ms (-2.6%)    | 1.03s → 1.01s (-1.9%)            | 19.06% → 20.15% (+5.7%)      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+----------------------------------+------------------------------+
| domain.canonical.sha256                  | 114526 → 114526 (+0.0%)    | 8.73µs → 8.56µs (-1.9%)        | 13.98µs → 13.91µs (-0.5%)      | 999.46ms → 980.32ms (-1.9%)      | 18.50% → 19.50% (+5.4%)      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+----------------------------------+------------------------------+
| query.artifact.finalization.advance_wake | 14 → 14 (+0.0%)            | 55.58ms → 52.98ms (-4.7%)      | 275.78ms → 266.60ms (-3.3%)    | 778.17ms → 741.71ms (-4.7%)      | 14.40% → 14.76% (+2.5%)      |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+----------------------------------+------------------------------+
| query.artifact.prepare_pages             | 13 → 13 (+0.0%)            | 60.88ms → 46.96ms (-22.9%) 🚀  | 89.19ms → 68.09ms (-23.7%) 🚀  | 791.46ms → 610.45ms (-22.9%) 🚀  | 14.65% → 12.15% (-17.1%)     |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+----------------------------------+------------------------------+
| code_index.chunk.index_file              | 276 → 276 (+0.0%)          | 2.05ms → 2.10ms (+2.4%)        | 3.05ms → 3.09ms (+1.3%)        | 564.57ms → 579.99ms (+2.7%)      | 10.45% → 11.54% (+10.4%)     |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+----------------------------------+------------------------------+
| code_index.extract.parser_artifact       | 276 → 276 (+0.0%)          | 1.89ms → 1.89ms (+0.0%)        | 2.90ms → 2.84ms (-2.1%)        | 520.56ms → 521.41ms (+0.2%)      | 9.63% → 10.37% (+7.7%)       |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.parallel_prepare    | 13 → 13 (+0.0%)            | 49.94ms → 36.49ms (-26.9%) 🚀  | 73.73ms → 52.89ms (-28.3%) 🚀  | 649.18ms → 474.32ms (-26.9%) 🚀  | 12.02% → 9.44% (-21.5%) 🚀   |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+----------------------------------+------------------------------+
| code_index.build.assemble                | 2 → 2 (+0.0%)              | 189.33ms → 186.55ms (-1.5%)    | 202.51ms → 196.21ms (-3.1%)    | 378.66ms → 373.10ms (-1.5%)      | 7.01% → 7.42% (+5.8%)        |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+----------------------------------+------------------------------+
| code_index.chunk.build                   | 276 → 276 (+0.0%)          | 1.25ms → 1.26ms (+0.8%)        | 1.83ms → 1.81ms (-1.1%)        | 343.70ms → 347.48ms (+1.1%)      | 6.36% → 6.91% (+8.6%)        |
+------------------------------------------+----------------------------+--------------------------------+--------------------------------+----------------------------------+------------------------------+

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