Skip to content

feat(hotpath): fill runtime-core db/io gaps - #775

Draft
ScriptedAlchemy wants to merge 4 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/hotpath-gap-fill-be1f
Draft

feat(hotpath): fill runtime-core db/io gaps#775
ScriptedAlchemy wants to merge 4 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/hotpath-gap-fill-be1f

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

One-crate gap-fill PR (HP-db-core): adds #[hotpath::measure] coverage to the tracedecay-runtime-core DB/IO kernel only — src/db/connection/facade.rs, src/db/connection/query_write.rs, and src/store/memory/crud/*. 59 new measure sites, attribute-only insertions, no behavior changes, no Cargo.toml changes.

Guarantees held:

  • hotpath stays opt-in (never in default/production); every macro is a no-op without --features hotpath.
  • No FunctionsCpu/samply enabled.
  • No existing #[hotpath::measure] sites restamped; hooks and host-integration untouched; no other crates touched.
  • No measures added to git_repository_authority test/bench files (owned by bc-30275fe8).
  • Trait-impl delegators left unmeasured to avoid double-counting; only inherent methods carry spans.

Verified: cargo check -p tracedecay-runtime-core and cargo check -p tracedecay-runtime-core --features hotpath both pass.

Files touched / new measure sites / new labels

File New sites New labels
src/db/connection/facade.rs 23 runtime_core.db.write_conn.query / .execute / .execute_batch / .long_lease_begin; runtime_core.db.read_conn.query / .snapshot_begin; runtime_core.db.snapshot.query; runtime_core.db.long_lease.batch / .commit / .rollback; runtime_core.db.memory_txn.query / .execute / .execute_batch / .commit / .rollback; runtime_core.db.write_txn.execute / .query / .execute_batch (each shared by the inherent + _engine twin) / .commit / .rollback
src/db/connection/query_write.rs 9 runtime_core.db.query_scalar; runtime_core.db.execute_write; runtime_core.db.execute_write_batch; runtime_core.db.authority_batch; runtime_core.db.writer.lane_wait; runtime_core.db.writer.open; runtime_core.db.snapshot.begin; runtime_core.db.write_txn.begin / .begin_bulk
src/store/memory/crud/commit.rs 8 runtime_core.memory.commit_fact; .last_event; .append_order_check; .replay_check; .collision_check; .anchors_ensure; .anchor_upsert; .assertion_insert
src/store/memory/crud/lineage.rs 6 runtime_core.memory.purged_projection_check; .event_refs_ensure; .event_insert; .projection_publish; .receipt_outcome; .fact_identity_ensure
src/store/memory/crud/commands.rs 5 runtime_core.memory.feedback_projection; .commit_receipt; .replay_add; .replay_update; .replay_remove
src/store/memory/crud/project.rs 3 runtime_core.memory.project_list; .project_find_digest; .active_fact_count
src/store/memory/crud/feedback.rs 3 runtime_core.memory.feedback_history; .replay_feedback; .fact_inspect
src/store/memory/crud/add.rs 2 runtime_core.memory.add_candidates; .add_classify

Skipped by design: #[cfg(test)] fixture methods, trait-impl delegators, trivial getters/constructors, and the drop-only ReadSnapshot::commit/rollback.

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: 859be98

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-gap-fill-be1f

Total Elapsed Time: 4.67s → 5.25s (+12.4%)
CPU Baseline: 69.79µs → 69.64µs (-0.2%)
Benchmark ID: index-bench-timing

timing - Execution duration of functions.

+------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| Function                                 | Calls                      | Avg                             | P95                              | Total                            | % Total                      |
+------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| tracedecay-index-bench                   | 1 → 1 (+0.0%)              | 4.67s → 5.25s (+12.4%)          | 4.67s → 5.26s (+12.6%)           | 4.67s → 5.25s (+12.4%)           | 100.00% → 100.00% (+0.0%)    |
+------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| query.artifact.append_pages              | 13 → 13 (+0.0%)            | 181.44ms → 206.76ms (+14.0%)    | 290.98ms → 333.45ms (+14.6%)     | 2.36s → 2.69s (+14.0%)           | 50.48% → 51.17% (+1.4%)      |
+------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.sqlite              | 13 → 13 (+0.0%)            | 137.97ms → 162.59ms (+17.8%)    | 232.13ms → 268.04ms (+15.5%)     | 1.79s → 2.11s (+17.9%)           | 38.39% → 40.24% (+4.8%)      |
+------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.postings            | 13 → 13 (+0.0%)            | 81.74ms → 81.34ms (-0.5%)       | 110.95ms → 111.48ms (+0.5%)      | 1.06s → 1.06s (+0.0%)            | 22.74% → 20.13% (-11.5%)     |
+------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.commit              | 13 → 13 (+0.0%)            | 53.27ms → 78.29ms (+47.0%) ⚠️   | 117.57ms → 182.58ms (+55.3%) ⚠️  | 692.56ms → 1.02s (+47.3%) ⚠️     | 14.82% → 19.37% (+30.7%) ⚠️  |
+------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| code_index.workers.install               | 83 → 83 (+0.0%)            | 12.15ms → 11.79ms (-3.0%)       | 39.55ms → 40.30ms (+1.9%)        | 1.01s → 978.37ms (-3.1%)         | 21.58% → 18.62% (-13.7%)     |
+------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| query.artifact.finalization.advance_wake | 14 → 14 (+0.0%)            | 50.00ms → 69.16ms (+38.3%) ⚠️   | 231.74ms → 278.13ms (+20.0%) ⚠️  | 699.94ms → 968.24ms (+38.3%) ⚠️  | 14.98% → 18.43% (+23.0%) ⚠️  |
+------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| CodeIndexProductionOwnerV1::extract_file | 276 → 276 (+0.0%)          | 3.96ms → 3.50ms (-11.6%)        | 7.82ms → 5.31ms (-32.1%) 🚀      | 1.09s → 964.84ms (-11.5%)        | 23.39% → 18.37% (-21.5%) 🚀  |
+------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| code_index.build.and_publish             | 2 → 2 (+0.0%)              | 416.49ms → 395.43ms (-5.1%)     | 433.85ms → 398.72ms (-8.1%)      | 832.98ms → 790.85ms (-5.1%)      | 17.83% → 15.05% (-15.6%)     |
+------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| domain.canonical.sha256                  | 114526 → 114526 (+0.0%)    | 6.83µs → 6.55µs (-4.1%)         | 10.82µs → 10.80µs (-0.2%)        | 782.41ms → 750.61ms (-4.1%)      | 16.75% → 14.29% (-14.7%)     |
+------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| query.artifact.prepare_pages             | 13 → 13 (+0.0%)            | 36.22ms → 36.84ms (+1.7%)       | 52.20ms → 55.71ms (+6.7%)        | 470.81ms → 478.95ms (+1.7%)      | 10.08% → 9.12% (-9.5%)       |
+------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| 🆕 query.artifact.finalization.commit    | 0 → 14 (+100.0%) ⚠️        | 0.00ns → 31.58ms (+100.0%) ⚠️   | 0.00ns → 210.24ms (+100.0%) ⚠️   | 0.00ns → 442.16ms (+100.0%) ⚠️   | 0.00% → 8.42% (+100.0%) ⚠️   |
+------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| code_index.chunk.index_file              | 276 → 276 (+0.0%)          | 1.79ms → 1.60ms (-10.6%)        | 4.25ms → 2.33ms (-45.2%) 🚀      | 493.36ms → 441.92ms (-10.4%)     | 10.56% → 8.41% (-20.4%) 🚀   |
+------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| code_index.extract.parser_artifact       | 276 → 276 (+0.0%)          | 1.69ms → 1.49ms (-11.8%)        | 4.00ms → 2.26ms (-43.5%) 🚀      | 465.66ms → 411.42ms (-11.6%)     | 9.97% → 7.83% (-21.5%) 🚀    |
+------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.parallel_prepare    | 13 → 13 (+0.0%)            | 28.08ms → 28.60ms (+1.9%)       | 40.60ms → 42.86ms (+5.6%)        | 365.03ms → 371.75ms (+1.8%)      | 7.81% → 7.08% (-9.3%)        |
+------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| 🗑️ code_index.chunk.build                | 276 → 0 (-100.0%) 🚀       | 1.10ms → 0.00ns (-100.0%) 🚀    | 2.21ms → 0.00ns (-100.0%) 🚀     | 302.34ms → 0.00ns (-100.0%) 🚀   | 6.47% → 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants