<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rspamd.git/src/lua/lua_classnames.h, branch master</title>
<subtitle>rspamd</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/atom/src/lua/lua_classnames.h?h=master</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/atom/src/lua/lua_classnames.h?h=master'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/'/>
<updated>2026-08-30T11:09:49Z</updated>
<entry>
<title>[Feature] Expose the suffix lookup to Lua</title>
<updated>2026-08-30T11:09:49Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2026-08-30T11:09:49Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=7318989ea80bb10d09deecda7328952e7f89aedb'/>
<id>urn:sha1:7318989ea80bb10d09deecda7328952e7f89aedb</id>
<content type='text'>
Custom suffix-like rule sets (exact, wildcard and exception rules with
longest-match semantics) can now be built through the C API and the new
rspamd_tld_lookup Lua module, which also queries the suffix list loaded
by rspamd itself. This gives modules like the RBL URL composition maps
the same per-label hash matching that the URL scanner uses instead of
regex based reimplementations.
</content>
</entry>
<entry>
<title>[Feature] lua: expose pdf ToUnicode CMaps to Lua</title>
<updated>2026-08-08T11:52:27Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2026-08-08T11:52:27Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=8460c703d45400afe56f806c69790808d4fc5b43'/>
<id>urn:sha1:8460c703d45400afe56f806c69790808d4fc5b43</id>
<content type='text'>
rspamd_pdf_text.cmap() parses a CMap stream and builder:set_cmap()
selects it, mirroring set_encoding() for simple fonts. A builder holds
one decoder at a time, so the two setters clear each other rather than
leaving both live.

The registry anchor that kept an encoding alive now covers either kind
of decoder, since both are plain userdata the C++ side dereferences.
</content>
</entry>
<entry>
<title>[Feature] lua: expose the pdf glyph decoder to Lua</title>
<updated>2026-08-08T10:53:22Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2026-08-08T10:53:22Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=2aa57b7405c699804d1389113bccdbc6c535ec76'/>
<id>urn:sha1:2aa57b7405c699804d1389113bccdbc6c535ec76</id>
<content type='text'>
rspamd_pdf_text wraps the libmime unit in two classes: an encoding,
built from a base encoding name and optionally a /Differences array
in its PDF form, and a builder that accumulates a page worth of runs
in one buffer.

The builder anchors the encoding object it was last given in the Lua
registry, so a font that is still current cannot be collected out
from under it, and finish() hands the buffer over as a text and
leaves the builder ready for the next page.
</content>
</entry>
<entry>
<title>[Feature] neural: static_embed provider (WordPiece + static matrix)</title>
<updated>2026-07-01T21:31:01Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2026-07-01T20:24:09Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=8c28072867c7b0cffb6b804ca0906cbab27404ad'/>
<id>urn:sha1:8c28072867c7b0cffb6b804ca0906cbab27404ad</id>
<content type='text'>
Add a static token-embedding provider (Model2Vec style), the cheap
multilingual successor to fasttext_embed: words from rspamd's regular
tokenization pipeline are re-tokenized into WordPiece subword tokens and
embedded by mean-pooling rows of a precomputed float32 matrix, with no
neural forward pass and no new dependencies.

- rspamd_static_embed: a Lua-C module combining a WordPiece tokenizer
  (BertNormalizer via ICU + Bert pre-tokenizer + greedy WordPiece) with
  an mmap-ed embedding matrix shared between workers. The model spec is
  read from the model directory (config.json + vocab.txt + matrix +
  optional HF tokenizer.json) and validated strictly, fail-fast: any
  unsupported normalizer/pre-tokenizer/model type, pooling other than
  mean, non-float32 matrix or size mismatch fails the load instead of
  degrading silently. get_sentence_vector() accepts a word list (the
  provider path) or a whole text; both produce identical vectors.
- The WordPiece tokenizer is internal to the vectorizer: the global
  word-breaking / statistics tokenization path is untouched, so Bayes
  tokens and fuzzy hashes are unaffected.
- static_embed provider: extracts words like fasttext_embed and feeds
  them to the model; the Lua side holds no matrix data and uses no FFI.
- unit tests with a generated fixture covering normalization, subword
  splitting, greedy matching, CJK padding, unk handling, mean pooling,
  word-list/text equivalence and strict rejection of unsupported
  configs (BPE model type, vocab/matrix size mismatches, pooling).

Verified against the reference tokenizer oracle: token ids match
exactly, pooled vectors match within 2.4e-05 max abs diff, and the
word-list path is bit-identical to raw-text tokenization on the corpus.
</content>
</entry>
<entry>
<title>[Feature] Add case-insensitive table type for HTTP headers</title>
<updated>2026-03-13T13:54:35Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2026-03-13T13:54:35Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=6eb3f014bc0972bbb47e99359936827504c87245'/>
<id>urn:sha1:6eb3f014bc0972bbb47e99359936827504c87245</id>
<content type='text'>
Introduce rspamd{caseless_table} userdata type that provides
case-insensitive key lookup while preserving original key case.
HTTP response headers now use this type instead of plain Lua tables,
fixing two issues: headers were forcibly lowercased (mutating original
data) and duplicate headers were silently lost.

Multi-value headers are stored as arrays and can be retrieved via
get_all(key). The __index metamethod returns the first value for
convenience. The type is generic and reusable beyond HTTP.
</content>
</entry>
<entry>
<title>[Feature] Replace libfasttext with mmap-based built-in shim</title>
<updated>2026-02-21T16:43:16Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2026-02-20T11:21:38Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=d96ee36102f5a1e211ad86fa273924a3d02a5cdd'/>
<id>urn:sha1:d96ee36102f5a1e211ad86fa273924a3d02a5cdd</id>
<content type='text'>
Replace the external libfasttext shared library dependency with a
zero-dependency C++20 shim that reads .bin/.ftz models directly.
The large input matrix is mmap'd with MAP_SHARED/PROT_READ so all
worker processes share the same physical pages after fork.

This eliminates:
- C++ exception ABI issues across shared library boundaries
  (no more fork-probe hack in lua_fasttext)
- The ENABLE_FASTTEXT cmake option (always compiled in now)
- Per-worker heap copies of the model (~500MB-7GB savings)

New files:
- contrib/fasttext_shim/fasttext_shim.{h,cxx} - built-in shim
- contrib/fasttext_shim/CMakeLists.txt
- lualib/plugins/neural/providers/ - embedding providers
- src/lua/lua_fasttext.cxx - rewritten Lua bindings
</content>
</entry>
<entry>
<title>[Minor] Slightly rework lua shingles to simplify storage</title>
<updated>2025-01-08T15:14:37Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2025-01-08T15:14:37Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=694d15a9af0baa186c6185c1c9da01f08f79dbbc'/>
<id>urn:sha1:694d15a9af0baa186c6185c1c9da01f08f79dbbc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[Rework] Further types conversion (no functional changes)</title>
<updated>2024-03-18T18:56:33Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2024-03-18T18:56:33Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=14c13854d3cae9d93c3d148be30fb72f1eaffe55'/>
<id>urn:sha1:14c13854d3cae9d93c3d148be30fb72f1eaffe55</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[Rework] Rework dynamic usage</title>
<updated>2024-03-05T15:29:33Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2024-03-05T15:29:33Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=bcd36f79596a8666217d29088f6b0040c6cf092b'/>
<id>urn:sha1:bcd36f79596a8666217d29088f6b0040c6cf092b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[Project] Convert the remaining</title>
<updated>2024-03-05T14:00:08Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2024-03-05T14:00:08Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=75327b3889c80ad0a0c95ccf4444b5c2bc148e14'/>
<id>urn:sha1:75327b3889c80ad0a0c95ccf4444b5c2bc148e14</id>
<content type='text'>
</content>
</entry>
</feed>
