Skip to content

impact/path: one facts export per graph, however many queries arrive at once - #1850

Merged
swapnilpaliwal-sd merged 2 commits into
0.1.9from
perf/single-flight-export
Oct 3, 2026
Merged

swapnilpaliwal-sd merged 2 commits into
0.1.9from
perf/single-flight-export

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor

Two agent-experience fixes measured on an 8,619-file Java repository.

One facts export per graph. The export the first query pays had no lock: a query that found the stamp stale while another process was already writing the same facts — the background warm-up index starts, a second query, several hooks at once — ran the whole export again beside it. Measured: the first query after index cost 193 s (107 s user + 77 s sys of thrash) against 8.8 s warm, and every concurrent query paid the same again. Now the first comer takes <facts>/.exporting, the others wait for its stamp and read what it wrote, and a lock whose writer died is taken over. Re-measured with the lock: the racing query spends 6 s user + 2.5 s sys waiting instead of re-exporting, and no lock is left behind.

An undeclared name that arrives through an import hints at staging. impact ApplicationContext on a repo without the dependency staged answers honestly ([name match], by-name rows) but gave no way out; it is the commonest setup gap and looks exactly like an engine gap. One hint line under the [text] rows now names the fix: axiomcode index --library <its source dir>.

Tests: new tests/export_singleflight.py pins the wait (a held lock makes a stale --warm wait and NOT re-export — the holder's stamp survives untouched), the takeover (a dead writer's lock is removed and the export runs) and the unlock. Also run: java cases 329/329, typescript 225/225, facts_cache, latency, freshness, refresh_races, front_door — all green.

swapnilpaliwal-sd and others added 2 commits October 2, 2026 16:57
…at once

The export had no lock: a query that found the stamp stale while another
process was already writing the same facts (the background warm-up after
index, a second query, several hooks at once) ran the whole export again
beside it. Measured on an 8,619-file Java repository: the first query
after index cost 193 s against 8.8 s warm, and every concurrent query
paid the same again while thrashing the writer.

The first comer now takes <facts>/.exporting and the others wait for its
stamp, then answer from the facts it wrote; a lock whose writer is gone
is taken over. tests/export_singleflight.py pins the wait, the takeover
and the unlock.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
…library staging

A name no graph declares, reached only by text, whose lines include an
import of it is the signature of an unstaged dependency — until now the
answer was indistinguishable from an engine gap, and the fix is one flag
away. One hint line under the [text] rows, only for undeclared names.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit e8fc153 into 0.1.9 Oct 3, 2026
12 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the perf/single-flight-export branch October 3, 2026 00:20
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.

1 participant