Skip to content

Release v0.3.11

Choose a tag to compare

@Kirky-X Kirky-X released this 25 Jul 20:00
· 238 commits to main since this release

L6+L7 memory-overflow fixes.

Bug Fixes

Peak memory on the 70 GB host dropped from 60 GB to ~4 GB.

  • L7-1 LZ4 buffer lifetime: remove the RamFirstSources field from ParsePhase, store the LZ4 compression buffer in PipelineCtx, and release it immediately after the parse phase reads it. Saves ~3 GB on a 10k-file repository.
  • L7-2 parse edge cleanup: after ScopeResolutionPhase clones edges into the graph, clear() + shrink_to_fit() result.edges and seen_qns. Saves ~1 GB on large repositories.
  • L7-3 PipelineCtx drain: LoadPhase uses ctx.remove to take ownership of ScanOutput/ResolveOutput and drops them immediately on return. Saves ~1–2 GB.
  • L7-4 RAM-first amplification factor: evaluate_ram_first_budget estimates peak RSS with total × 8 and compares against max_rss_bytes / 2, correcting budget distortion. A 70 GB host allows ~2.2 GB repositories to use RAM-first; a 4 GB laptop allows only ~125 MB.
  • L7-5 LadybugDB buffer_pool cap: set buffer_pool_size=4GB/max_db_size=16GB/max_num_threads=8 explicitly in the production SystemConfig. DuckDB defaults to 80% of physical memory (~56 GB on a 70 GB host), the main remaining bottleneck after L6. Saves ~52 GB.
  • L7-6 LSP on-demand startup: enhance_with_lsp first queries Function/Method rows, collects the set of extensions actually present, and only start()s the needed LSP providers. Pure-Rust repositories now start only rust-analyzer, saving ~3–5 GB.
  • L7-4/6 memory-overflow fix — RAM-first amplification + LSP on-demand
  • L7-5/2/3 memory-overflow fix — LadybugDB cap + parse edge cleanup + ctx drain
  • L7-1 memory-overflow fix — drop LZ4 buffers after parse phase
  • bound force_kill_and_wait with KILL_TIMEOUT_MS + fail-loud warnings
  • L6 memory-overflow fix — pipeline streaming + LSP kill timeout

Other Changes

  • L6-1 pipeline streaming + ctx.take(): ResolvePhase now uses ctx.remove::<ScopeOutput>("scope") to take ownership of the Graph (replacing scope.graph.clone(), eliminating multi-GB deep-clones on large repositories); the Phase::run signature changes from &PipelineCtx to &mut PipelineCtx to support exclusive borrowing for ctx.remove.
  • L6-3 iterator API: change the signatures of save_nodes/save_edges/write_nodes_csv_stream/write_edges_csv_stream from &[Node]/&[Edge] to impl IntoIterator<Item = &Node/&Edge>, eliminating Vec<Node>/Vec<Edge> intermediate collections; a 64KB BufWriter reduces syscalls.
  • L6-3 LSP kill timeout: force_kill_and_wait uses wait_with_timeout instead of child.wait() (preventing permanent blocking on D-state/zombie processes); add KILL_TIMEOUT_MS=3000/SHUTDOWN_TIMEOUT_MS=5000 constants.
  • | Dimension | CRITICAL | HIGH | MEDIUM | LOW | Conclusion |
  • |------|----------|------|--------|-----|------|
  • | tiangang SAST | 0 | 0 | 1 | 4 | ✅ release approved |
  • | diting architecture | 0 | 1 (fixed) | 1 | 1 | ✅ release approved |
  • | diting performance | 0 | 0 | 2 | 3 | ✅ release approved |
  • All MEDIUM/LOW findings are non-blocking and have been recorded on the v0.3.12 agenda.
  • cargo clippy --lib --features "core"/"full" -- -D warnings: 0 warnings
  • cargo test --lib --features "full": 4461 passed, 0 failed
  • cargo test --lib --features "core": 2260 passed, 0 failed
  • cargo test --tests --features "full": 163 integration tests passed
  • pre-push hook: fmt/check/clippy/test/coverage 95%/audit/deny all green
  • v0.3.11 — L6+L7 memory-overflow fix changelog + roadmap + version bump
  • record L6 memory-overflow fix + fix version links

Full changelog: v0.3.10...v0.3.11