Skip to content

js, python, csharp rules: the profiled hot shapes, one language at a time - #1863

Merged
swapnilpaliwal-sd merged 3 commits into
apps/integration-0.1.9from
perf/js-cs-datalog-rules
Oct 8, 2026
Merged

swapnilpaliwal-sd merged 3 commits into
apps/integration-0.1.9from
perf/js-cs-datalog-rules

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor

The profiling sweep (AXIOM_DL_PROFILE, same instrument as the TS and Java rounds) applied to the three remaining languages, every change gated by sorted-identical output relations on identical staged facts plus the language's suite leg:

Language Fix Serial solve
JavaScript carry_step anchored on every variable USE and re-scanned all assignments per use (3.1 of 6 minutes, half the profile); var_assigned_value(v,c) keys it. state_leak crossed every (type, entry) with every assignment (33s for 2 rows); func_written_onto(t,f,owner) keys it. 280s → 81s (−71%), parity ✅, suite 296/307 (the same 11 const-object checks that fail on the base)
Python (round three) root_expr_at materializes the statement-pairing key (iter/with, 22s); five attribute-prefix clauses round two's regex missed (context atoms mid-prefix) now probe attr_access (~27s); replaced_method_of hoists the mro member lookup below the fixpoint (12s). 193s → 124s (−33%; 885s → 124s across the three rounds, 7.1x), parity ✅, suite 306/306
C# call_chain_summary re-counted each tier once per site (9.8s of 36s for 7 rows); call_class_kind drives it once per distinct tier — the python site_class_kind fix ported. 36s → 22s (−39%), parity ✅, suite 208/208

With the parallel solve (PR #1861) on top, estimated big-subject parallel solves land at roughly: JS ~30s (was 449s at session start), Python ~45s (was 1,445s cloud), C# ~11s.

Remaining profile tails per language are flat after these (≤5s/rule); next-largest items noted in the dogfood log (extension_match C#, expr_denotes_bound_method python).

swapnilpaliwal-sd and others added 3 commits October 8, 2026 03:36
…site

The souffle profile on a 2,250-file subject put 9.78s of a 36s solve — the single hottest
rule — in call_chain_summary producing 7 rows: driven by call_class rows, the aggregate
re-counted a tier once per SITE in it. call_class_kind(cls) drives it once per DISTINCT
tier, the same fix the python engine's site_class_kind carries. Serial solve on identical
facts: 36s -> 22s (-39%), every output relation sorted-identical.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
… attribute prefixes adopted, the mro lookup hoisted

The round-two profile on a django-sized subject named three shapes, all familiar:

- root_expr_at(p, rc, scope, line, e) holds each context's root expression WITH the keys
  the statement pairings join on. Written inline, iter_pair and with_pair each enumerated
  one side's roots and probed scope and span per candidate — 22s between them for ~6K rows;
  each pairing is now one indexed join.
- five attribute-access clauses still carried the expr_node/expr_parent prefix inline —
  the context-test variants (STORE / not-STORE / not-callee) that round two's regex missed
  because atoms sit between the prefix parts. They now probe attr_access and keep their
  context atoms: instance_attr_method_value, expr_denotes_method, element_type_of and kin,
  ~27s of the profile.
- replaced_method_of(p, c, n, def) hoists mro_lookup_decorated's pure-syntax member lookup
  below the fixpoint (12s re-derived every iteration for 783 rows).

Gate on identical staged django facts, same machine: serial solve 193s -> 124s (-33%;
cumulative with rounds one and two, 885s -> 124s, 7.1x), every output relation
sorted-identical.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
The souffle profile on a 257MB app put 3.1 of 6 minutes in ONE clause: carry_step anchored
on expr_binding visited every USE of every variable and re-scanned the assignments for
each. var_assigned_value(v, c) enumerates the assignments once, keyed by the variable, and
carry_step is one indexed join. state_leak's instance-write clause crossed every (type,
entry) pair with every assignment in the program — 33s for two rows; func_written_onto
(t, f, owner) enumerates the assignment side once, keyed (type, func).

Gate on identical staged facts, same machine: serial solve 280s -> 81s (-71%), every
output relation sorted-identical.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit 5b1087b into apps/integration-0.1.9 Oct 8, 2026
12 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the perf/js-cs-datalog-rules branch October 8, 2026 17:43
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