Skip to content

fix(#11145, #11146, #11051, #11029): labelpropagation seeds, personalizedPageRank direction/weights, algo config keys refused, case-insensitive SQL function factory - #11148

Merged
lvca merged 5 commits into
mainfrom
fix/11145-11146-11051-11029
Nov 2, 2026
Merged

lvca merged 5 commits into
mainfrom
fix/11145-11146-11051-11029

Conversation

@lvca

@lvca lvca commented Nov 2, 2026

Copy link
Copy Markdown
Member

Summary

Shared helpers added to AbstractAlgoProcedure: extractConfig (key allow-list), extractDirection(value, default) (moved from AlgoPageRank, strict), loadGraphFromRecords.

Docs updated in arcadedb-docs (community-detection, centrality, notes).

Tests

  • Issue11051FunctionNameCaseTest: every built-in agrees across hasFunction/isBuiltIn/isSharedInstance/getFunctionInstance under its canonical camelCase and upper-case spelling; Cypher CALL of camelCase built-ins; unregister of instance and class registrations under another case, aliases included.
  • Issue11145LabelPropagationSeedsTest: report repro, fixed seeds classify both triangles, unfixed seeds, tie-break combination, invalid configs, unknown keys on LPA/pagerank/louvain, OLTP vs view parity.
  • Issue11146PersonalizedPageRankDirectionTest: report repro (OUT/IN/BOTH), weights split proportionally, weights + direction, map vs positional parity, invalid configs, OLTP vs view parity.
  • Issue11038BindCountAndNameLifecycleIT#literalDollarDigitsDeclareNoParameter.
  • Ran 2700 related engine tests (all algo.*, graph.olap, function.sql, every test using algo. or CALL ns.fn) plus the postgresw IT: all green.

…izedPageRank direction and weights, algo config keys refused, case-insensitive SQL function factory

- #11145: algo.labelpropagation reads pre-assigned integer labels from seedProperty (Neo4j GDS convention: a seeded
  community reports its seed value, any other is numbered past the largest seed) and keeps them for the whole run with
  fixedSeeds, on both the OLTP and the Graph Analytical View path (new GraphAlgorithms.labelPropagation kernel taking
  initial labels and a fixed mask). Every algo.* procedure with a config/options map now refuses an unknown key instead
  of silently running with defaults.
- #11146: algo.personalizedPageRank accepts a config map as second argument with relTypes, dampingFactor,
  maxIterations, tolerance, direction (OUT default, IN, BOTH) and weightProperty. One push-based iteration serves both
  paths; weights come from the view's edge columns or the edge records.
- #11051: SQLFunctionFactoryTemplate routes every map access through one key() normaliser, so hasFunction,
  isSharedInstance, isBuiltIn and unregister agree with register/getFunctionInstance: CALL vector.l2Distance(...) and
  CALL geo.asText(...) resolve, and unregister removes the function and its aliases under any case.
- #11029: already fixed by #11018 (literal-aware placeholder scan); wire-level regression added for the reported shape.
@lvca lvca added this to the 26.11.1 milestone Nov 2, 2026
@lvca lvca self-assigned this Nov 2, 2026
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@mergify

mergify Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@claude

claude Bot commented Nov 2, 2026

Copy link
Copy Markdown

Review (light pass, diff skimmed, not built or run): this is a maintainer PR with focused changes and regression tests for each issue (#11145, #11146, #11051, #11038). I saw no security concerns: there are no new dependencies, no I/O or reflection, and the config allow-list tightens input handling.

Points to check:

  • Rejecting unknown config keys in 13 procedures is a behaviour change. Callers that pass extra keys today will start to fail, so mention it in the release notes.
  • Check the key() normaliser in SQLFunctionFactoryTemplate for locale-sensitive lowercasing. It should use Locale.ROOT, or the Turkish-i problem appears.
  • The push-based PPR iteration skips zero-score nodes. Make sure dangling-node mass and the tolerance convergence check behave the same as before on both the OLTP and view paths.
  • For fixedSeeds, confirm a seed label stays fixed when the seed value is larger than the node count. Also confirm that negative or duplicate seed values are rejected or handled.

Nice work overall.

@codacy-production

codacy-production Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics -36 complexity

Metric Results
Complexity -36

View in Codacy

🟢 Coverage 94.67% diff coverage

Metric Results
Coverage variation Report missing for c65ba9a1
Diff coverage ✅ 94.67% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (c65ba9a) Report Missing Report Missing Report Missing
Head commit (93ea1eb) 291914 241757 82.82%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#11148) 300 284 94.67%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

…Rank, pin seeds larger than the node count and negative seeds
@claude

claude Bot commented Nov 2, 2026

Copy link
Copy Markdown

Review of #11148 (skimmed the diff; I did not build or run the tests).

Overall: The change is clean and well documented. The new tests cover each of the four issues.

Points to check:

  1. Strict config keys are a behaviour change. extractConfig now throws on unknown keys in 13 procedures. Callers that pass extra keys today (for example relTypes or nodeLabels in a config map) will start failing. Please check that every *_KEYS set lists every key the procedure actually reads, including keys read through helpers like configNumber and extractRelTypes. A parametrised test that feeds each documented key to each procedure would catch an omission. Also call out the change in the release notes.
  2. unregister with aliases. It now also removes the function's name and aliases while they still map to the same registration. The FunctionRegistry entry is intentionally left in place, as the existing comment says. That means unregister still leaves the function resolvable cross-engine, which is worth keeping in mind.
  3. labelPropagation with fixed. The fixed loop skips updating those nodes, which relies on newLabels being pre-copied from labels each iteration. Please confirm the copy happens every iteration, not only before the first. The hunk context suggests it does.
  4. Style. java.util.Set is imported out of alphabetical order, ahead of Random, in AlgoFastRP and AlgoGraphSAGE. This is minor.

Security: I found no concerns. The PR adds no new dependencies, I/O, reflection or external input handling. The unknown-key rejection tightens input validation.

Nice work.

@claude

claude Bot commented Nov 2, 2026

Copy link
Copy Markdown

Review (quick skim, maintainer-authored PR): no security concerns found. Changes are confined to algo procedures, the function-factory key normalisation and tests. No new dependencies, I/O or reflection.

Notes:

  • Strict unknown-key rejection across 13 procedures is a behaviour change. Anyone passing extra keys now gets an error, so it's worth a changelog line.
  • Check that key() normalisation uses a fixed locale (Locale.ROOT) so lookups don't break under the Turkish locale.
  • Check that the push-based PPR iteration allocates no per-iteration arrays and skips zero-score nodes using primitive arrays.
  • Tests cover seeds, fixed seeds, direction and case handling, and the postgres wire regression. A negative test for out-of-range or non-integer seed values would round that out.

Overall this looks good.

@claude

claude Bot commented Nov 2, 2026

Copy link
Copy Markdown

Review of #11148 (LPA seeds, personalized PageRank config, function-name case normalisation).

Overall: the changes are clean and well tested. I found no blocking issues and no security concerns.

What I checked

  • SQLFunctionFactoryTemplate: every map access now goes through one key() helper. unregister removes the aliases only while they still map to the same registration (remove(key, value)), so it can't drop another function's alias.
  • GraphAlgorithms.labelPropagation: the old overload now delegates to the new kernel. The rank-to-node remap stays in the wrapper, and the initialLabels and fixed lengths are validated. Fixed nodes skip the update loop but still spread their label.
  • extractConfig and extractDirection are small and strict. The error messages list the accepted keys.
  • The new tests cover the report repros, OLTP vs view parity, and invalid configs. I did not run them.

Points for you to consider

  1. Behaviour change: 13 algo.* procedures now throw on unknown config keys. That is the right call, but any existing caller that passes extra keys, such as a shared options map, will start failing. It is worth a line in the release notes.
  2. unregister deliberately leaves FunctionRegistry untouched (existing behaviour). After the case fix, a function can still be found through the registry after unregister. This is not a regression, but the Javadoc could say so explicitly.
  3. In the LPA kernel, with fixed set, a seed-heavy graph may converge in a single pass for the fixed nodes. Fixed nodes are skipped in the loop, so they never feed localChanged, which is correct. A test with a fixed seed whose neighbours oscillate would pin down that termination.

The code follows the CLAUDE.md conventions (final params, imports, tests per issue).

…-11146-11051-11029

# Conflicts:
#	engine/src/main/java/com/arcadedb/query/opencypher/procedures/algo/AlgoHashGNN.java
@lvca
lvca merged commit 79ff674 into main Nov 2, 2026
10 of 12 checks passed
@lvca
lvca deleted the fix/11145-11146-11051-11029 branch November 2, 2026 18:00
@claude

claude Bot commented Nov 2, 2026

Copy link
Copy Markdown

Review (light, from skimming the diff): this is a maintainer PR with no security concerns that I could find. I found no process execution, deserialization, network access or new dependencies. The new config-key allow-list on the algo.* procedures tightens input handling.

  • Design: The shared helpers in AbstractAlgoProcedure (extractConfig, extractDirection) and the single key() normaliser in SQLFunctionFactoryTemplate reduce duplication.
  • Tests: Coverage looks good: regression tests per issue, OLTP vs view parity, invalid configs, and unregister under different case.
  • Behaviour change: Rejecting unknown config keys on 13 procedures is stricter than before. Existing users who pass extra keys will now get errors, so please call it out in the release notes.
  • Performance: The push-based personalized PageRank skips zero-score nodes, which should help. Please confirm the per-iteration allocations stay on primitive arrays, per CLAUDE.md.

Nothing blocking from my side.

@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.33333% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.34%. Comparing base (c17caaf) to head (93ea1eb).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...encypher/procedures/algo/AlgoLabelPropagation.java 89.62% 5 Missing and 6 partials ⚠️
...pher/procedures/algo/AlgoPersonalizedPageRank.java 92.03% 5 Missing and 4 partials ⚠️
.../java/com/arcadedb/graph/olap/GraphAlgorithms.java 66.66% 3 Missing and 3 partials ⚠️
...adedb/function/sql/SQLFunctionFactoryTemplate.java 80.00% 1 Missing and 3 partials ⚠️
...ncypher/procedures/algo/AbstractAlgoProcedure.java 87.50% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               main   #11148    +/-   ##
==========================================
  Coverage     79.33%   79.34%            
- Complexity     4961     4964     +3     
==========================================
  Files          2324     2324            
  Lines        258937   259087   +150     
  Branches      56738    56772    +34     
==========================================
+ Hits         205437   205580   +143     
- Misses        32568    32575     +7     
  Partials      20932    20932            

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

robfrank pushed a commit that referenced this pull request Nov 5, 2026
…izedPageRank direction/weights, algo config keys refused, case-insensitive SQL function factory (#11148)

* fix(#11145, #11146, #11051, #11029): labelpropagation seeds, personalizedPageRank direction and weights, algo config keys refused, case-insensitive SQL function factory

- #11145: algo.labelpropagation reads pre-assigned integer labels from seedProperty (Neo4j GDS convention: a seeded
  community reports its seed value, any other is numbered past the largest seed) and keeps them for the whole run with
  fixedSeeds, on both the OLTP and the Graph Analytical View path (new GraphAlgorithms.labelPropagation kernel taking
  initial labels and a fixed mask). Every algo.* procedure with a config/options map now refuses an unknown key instead
  of silently running with defaults.
- #11146: algo.personalizedPageRank accepts a config map as second argument with relTypes, dampingFactor,
  maxIterations, tolerance, direction (OUT default, IN, BOTH) and weightProperty. One push-based iteration serves both
  paths; weights come from the view's edge columns or the edge records.
- #11051: SQLFunctionFactoryTemplate routes every map access through one key() normaliser, so hasFunction,
  isSharedInstance, isBuiltIn and unregister agree with register/getFunctionInstance: CALL vector.l2Distance(...) and
  CALL geo.asText(...) resolve, and unregister removes the function and its aliases under any case.
- #11029: already fixed by #11018 (literal-aware placeholder scan); wire-level regression added for the reported shape.

* review: explicit non-negative finite weight check in personalizedPageRank, pin seeds larger than the node count and negative seeds

* review: java.util import order in the algo procedures

* review: pin the refusal of a seed that leaves no room to number the unseeded nodes

(cherry picked from commit 79ff674)
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