Performance refactor: faster reasoning/grounding and bounded abduction #5

Merged
davidfactor merged 6 commits from feat/perf-refactor into main 2026-02-02 00:25:46 +00:00
davidfactor commented 2026-02-02 00:20:14 +00:00 (Migrated from codeberg.org)

Summary

This PR focuses on performance and stability improvements across reasoning, grounding, and abduction. The biggest wins come from a new worklist/status-table reasoning path, faster grounding with indexing and delta chaining, and abduction changes that avoid worst‑case blowups. It also adds max‑solution limits and improves deduplication to keep search bounded.

Key Changes

  • Reasoning: worklist/status-table engine with incremental recomputation and state caching.
  • Grounding: predicate indexing, delta chaining, and deduped grounded rule instances.
  • Abduction: iterative deepening, strict --max enforcement, and faster deduplication.
  • Micro‑opts: superiority index lookup and canonical literal ordering without string
    allocations.
  • JSON output: stringify provenance + normalize hash annotations.

Benchmarks (from ABDUCTION_PERF_REPORT.md)

  • Real theory status: ~4.5s → ~0.3s (~15×).
  • Grounding: ~24–74s → ~0.2–0.5s (previous benchmark set).
  • Abduction “cliff” cases now complete sub‑second instead of stalling.

Tests

  • Added/updated coverage for iterative deepening, deduplication correctness, superiority index lookup, and deterministic literal ordering.
  • Full suite passes (820 tests) per report.

Notes

  • Biggest end‑to‑end gains come from reasoning + grounding.
  • Abduction changes mainly prevent worst‑case slowdowns rather than reduce base reasoning time.
# Summary This PR focuses on performance and stability improvements across reasoning, grounding, and abduction. The biggest wins come from a new worklist/status-table reasoning path, faster grounding with indexing and delta chaining, and abduction changes that avoid worst‑case blowups. It also adds max‑solution limits and improves deduplication to keep search bounded. ## Key Changes - Reasoning: worklist/status-table engine with incremental recomputation and state caching. - Grounding: predicate indexing, delta chaining, and deduped grounded rule instances. - Abduction: iterative deepening, strict --max enforcement, and faster deduplication. - Micro‑opts: superiority index lookup and canonical literal ordering without string allocations. - JSON output: stringify provenance + normalize hash annotations. ### Benchmarks (from ABDUCTION_PERF_REPORT.md) - Real theory status: ~4.5s → ~0.3s (~15×). - Grounding: ~24–74s → ~0.2–0.5s (previous benchmark set). - Abduction “cliff” cases now complete sub‑second instead of stalling. ### Tests - Added/updated coverage for iterative deepening, deduplication correctness, superiority index lookup, and deterministic literal ordering. - Full suite passes (820 tests) per report. ### Notes - Biggest end‑to‑end gains come from reasoning + grounding. - Abduction changes mainly prevent worst‑case slowdowns rather than reduce base reasoning time.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
anuna-research/spindle-racket!5
No description provided.