]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Fix] Prefer higher version ANN profiles when symbol distances are equal
authorVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 20 Jan 2026 11:09:47 +0000 (11:09 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 20 Jan 2026 11:09:47 +0000 (11:09 +0000)
commitd16db9dd67072df1dbb8d14fbdef467d29232e82
tree5d2d5513b778ac9f4792a7ad685e54cde59c9363
parentd6ddb88784e0b6604632ee6d044d83e579e3aef8
[Fix] Prefer higher version ANN profiles when symbol distances are equal

When multiple ANN profiles have the same symbol distance, the profile
selection would pick the first one encountered rather than the newest.
This caused issues when a newly trained ANN (version 1) existed alongside
the initial profile (version 0) - the scanner would select version 0
which had no actual ANN data.

Fix by adding a secondary selection criterion: when distances are equal,
prefer the profile with the higher version number.
src/plugins/lua/neural.lua