Skip to content

[codex] Fix GNN default gating threshold#1845

Merged
FlorianPfaff merged 2 commits intomainfrom
codex/fix-gnn-gating-threshold
Apr 25, 2026
Merged

[codex] Fix GNN default gating threshold#1845
FlorianPfaff merged 2 commits intomainfrom
codex/fix-gnn-gating-threshold

Conversation

@FlorianPfaff
Copy link
Copy Markdown
Owner

Summary

  • Remove the extra square from GlobalNearestNeighbor's default gating_distance_threshold.
  • Add a focused regression test that checks the default threshold is chi2.ppf(0.999, 2).

Root cause

scipy.spatial.distance.cdist(..., "mahalanobis") returns the Mahalanobis distance, while the default threshold was set to chi2.ppf(0.999, 2) ** 2. That squared the chi-square quantile a second time and made the default gate much too permissive.

Validation

  • Verified the branch diff contains only the GNN threshold change and the new regression test.
  • Not run locally; this Codex session has a read-only filesystem, so CI should run the test matrix on the PR.

@github-actions
Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 13.46s
✅ JSON prettier 2 0 0 0 0.45s
✅ JSON v8r 2 0 0 2.55s
✅ MARKDOWN markdownlint 2 0 0 0 0.68s
✅ MARKDOWN markdown-table-formatter 2 0 0 0 0.24s
✅ PYTHON bandit 383 0 0 5.99s
✅ PYTHON black 383 33 0 0 10.93s
✅ PYTHON flake8 383 0 0 3.35s
✅ PYTHON isort 383 37 0 0 0.76s
✅ PYTHON mypy 383 0 0 5.24s
✅ PYTHON pylint 383 0 0 115.19s
✅ PYTHON ruff 383 37 0 0 0.09s
✅ REPOSITORY checkov yes no no 23.41s
✅ REPOSITORY gitleaks yes no no 7.8s
✅ REPOSITORY git_diff yes no no 0.03s
✅ REPOSITORY secretlint yes no no 7.46s
✅ REPOSITORY syft yes no no 5.91s
✅ REPOSITORY trivy-sbom yes no no 2.1s
✅ REPOSITORY trufflehog yes no no 19.76s
✅ YAML prettier 4 0 0 0 0.5s
✅ YAML v8r 4 0 0 5.09s
✅ YAML yamllint 4 0 0 0.47s

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@9.4.0 --custom-flavor-setup --custom-flavor-linters PYTHON_PYLINT,PYTHON_BLACK,PYTHON_FLAKE8,PYTHON_ISORT,PYTHON_BANDIT,PYTHON_MYPY,PYTHON_RUFF,COPYPASTE_JSCPD,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_GITLEAKS,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@FlorianPfaff FlorianPfaff marked this pull request as ready for review April 25, 2026 08:32
@github-actions
Copy link
Copy Markdown
Contributor

Test Results

    12 files  +    4      12 suites  +4   4h 29m 15s ⏱️ + 2h 43m 35s
 1 091 tests +    1   1 091 ✅ +    1      0 💤 ±  0  0 ❌ ±0 
13 376 runs  +4 444  10 284 ✅ +3 680  3 092 💤 +764  0 ❌ ±0 

Results for commit 4f83fd6. ± Comparison against base commit 24543a9.

@FlorianPfaff FlorianPfaff merged commit 2945902 into main Apr 25, 2026
19 checks passed
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