Main took semantic index version 12 for its Markdown section change, so
the Next.js App Router routes move to version 13 with their own history
entry. pipeline_nextjs_semantic_upgrade_issue759 now starts from a
version-12 index.
Signed-off-by: Petteri Ponsimaa <petterip@gmail.com>
Since #2371 the clauses of a multi-clause function fold into one Function
node whose span covers all of them, but only the first clause was measured:
the folded node kept the complexity, cognitive, loop and access metrics and
the line count of that clause while its span grew.
fold_elixir_clause now receives the metrics of each clause it folds and
adds them to the node: cyclomatic, cognitive and loop_count add up,
loop_depth and max_access_depth take the deepest clause, every clause past
the first adds one dispatch decision to cyclomatic, and lines is recomputed
from the folded span. A clause whose walk reports
CBM_WALK_METRIC_UNAVAILABLE makes the folded value unavailable rather than a
partial sum. This is the treatment proposed in the PR description and
agreed in the review thread.
Indexed elixir-lang/elixir (669f8481, 6703 Elixir Function nodes) against
the merge parent: the 2212 folded functions change, the 4491 single-clause
functions keep identical metrics, Functions with complexity above 0 go from
3412 to 4785, and every node now has lines equal to its span (4491 did
before).
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
elixir_compute_complexity kept its pending frames in one fixed 4096-entry
array (48 bytes each, 196,608 bytes in a single stack frame) and stopped
pushing children once it was full. Children are pushed last to first, so a
wider body lost its FIRST children and the function reported a lower
complexity with no signal, on exactly the largest functions. Worker threads
do not get the 8 MB main-thread stack, so the array was a risk of its own.
It now uses the walker pattern cbm_compute_complexity has used since #2375:
a 512-frame on-stack first chunk that spills to the heap through
cbm_walk_stack_reserve (memory core, class EXTRACT) and is released with
cbm_walk_stack_release. If the stack cannot grow, every metric reports
CBM_WALK_METRIC_UNAVAILABLE instead of an undercount. This answers items 2
and 3 of the 2026-08-20 review.
The new test builds a 5000-statement body of alternating if and for. The
fixed stack reports complexity 4095 for it instead of 5000.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
The 2026-08-20 review asked for the fingerprint to be equal for two
structurally identical functions with different names, since duplicate
detection is what it exists for. tally repeats the body of summarize with
every function and variable name changed, and both must carry the same
MinHash values. The fingerprint hashes normalised leaf token kinds, so names
never enter it.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
The carried #1731 test asserted complexity and line counts but never the fingerprint, which is half of what the change adds. A body past the MinHash size gate must now carry one, and a one-expression body must not. Raised in the 2026-08-20 review.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Brings the branch up to f6fb3e0d, which carries #2371 (guarded def heads,
the multi-clause fold and typespec attributes) and #1730.
Two files conflicted, both at spots where main rewrote the Elixir
definition code. Each is rebuilt as the main version of the file plus the
lines this branch adds, at the same place; no conflict side is
concatenated:
- internal/cbm/extract_defs.c: the complexity helpers sit between the
definition comment and extract_elixir_func_def as before, and the
metrics plus fingerprint block follows def.is_exported in the unfolded
path.
- tests/test_extraction.c: TEST(elixir_complexity_and_fingerprint) and
its RUN_TEST go just before the Haskell block, after the Elixir tests
main added.
Per-file patch-id (git diff -U0 | git patch-id --stable) of this merge
against origin/main equals the branch change against its old base:
extract_defs.c b591a7bc, test_extraction.c 7b507156. The merge removes no
line of either file.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Main has used semantic index versions 10 and 11 since this branch took 10,
so the Next.js App Router routes move to version 12 with their own history
entry: an index main wrote at 11 rebuilds once for the new Routes.
pipeline_nextjs_semantic_upgrade_issue759 now starts from a version-11 index.
The other conflicts were tests both sides added at the same place; both kept.
Signed-off-by: Petteri Ponsimaa <petterip@gmail.com>
Recognize explicit C-family code in .inc files before extraction while
preserving BitBake recipe bodies and ObjectScript markers. Exercise disk
and byte classifiers, callback/linkage extraction and fast/full indexing.
Signed-off-by: knewstimek <knewstimek@users.noreply.github.com>
origin/main (#2305) moved the route-registration checks of the sequential
resolver into calls_emit_route_call and made emit_classified_edge return
whether it emitted. Keep the structure and bookkeeping of main and carry
the ServeMux pattern reading over: emit_classified_edge and
calls_emit_route_call now take the registration path from route_reg_path,
so "POST /v1/x" patterns register in both passes as before.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>