8000 Move index page I/O into a shared rust/mwmbl_core crate by daoudclarke · Pull Request #639 · mwmbl/mwmbl · GitHub
[go: up one dir, main page]

Skip to content

Move index page I/O into a shared rust/mwmbl_core crate - #639

Closed
daoudclarke wants to merge 7 commits into
mainfrom
claude/funny-fermi-gi5gi0
Closed

daoudclarke wants to merge 7 commits into
mainfrom
claude/funny-fermi-gi5gi0

Conversation

@daoudclarke
@daoudclarke daoudclarke commented Nov 11, 2026 •
Copy link
Copy Markdown
Contributor

Part of #629.

What changed

The server-side half of Lama's Rust crawler work in #629, so the shared page format can land on main without waiting for the crawler.

History: the first six commits are Lama's commits from rust_crawl, cherry-picked unchanged (their merges of main are left out). The last commit is mine. It keeps what the server uses and removes the crawler-only parts, which stay on rust_crawl. The overall diff is only what's listed below.

  • rust/mwmbl_core: the new crate from rust_crawl, holding only index.rs, which is byte-for-byte the same as on that branch. mwmbl_rank/src/index.rs keeps only the PyO3 layer and calls into it. The mwmbl_rank clippy cleanups, the Dockerfile lines and the removal of the stray rust-xgboost gitlink (no .gitmodules entry) also come from draft: Rust crawler #629.
  • Trimmed dependencies: mwmbl_core depends only on serde_json and zstd 0.13, matching mwmbl_rank. The crawler binary, the blacklist and indexer modules and the HN domains table stay on rust_crawl, along with tokio, reqwest, redis and anyhow, so the server's extension doesn't link them. There's one zstd in mwmbl_rank/Cargo.lock, not two.
  • Rust tests (rust/mwmbl_core/tests/index.rs): round trips, neighbouring pages left intact, term filtering (own term, null, truncated tuple, non-string), packing to the longest prefix that fits, and the ways a read can fail (zeroed page, short file, oversized frame header, bad JSON, a syscall error).
  • CI: make rust-core runs cargo fmt --check, clippy -D warnings and cargo test on the crate. It runs in the test job.
  • Release check: adds rust/mwmbl_core/ to CRAWLER_DIRECTORIES. The crawler links the crate through mwmbl_rank, so a change to the page format needs a crawler release.

Why

We're merging the Rust work in steps: Rust code goes to main once the server uses it, or once tests check it against the Python. The page I/O is already what the server runs. The crawler-only modules wait until they have tests that compare them with the Python.

For rust_crawl

These are cherry-picks rather than Lama's original commits, so merging main into rust_crawl won't delete the crawler code that main doesn't have. It should only conflict in rust/mwmbl_core/Cargo.toml, lib.rs and the lockfiles. To resolve, keep that branch's module list and dependencies, with zstd at 0.13.

Verification

  • make rust-core: fmt and clippy are clean, and 11 Rust tests pass.
  • uv run maturin develop, then the index and rank tests (test_index_page_writes, test_index_page_api, test_indexer, test_copy_index, test_rust_*, test_rank*): 111 passed.
  • Full make test: 1883 passed. make check: passed.

Size: 579 added lines excluding lockfiles. 251 of those are index.rs moved from mwmbl_rank, which loses 229.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DTbu4qHPfdk1QZ2ZSYHnn7

No functional changes to the crawler.
No functional changes to the crawler.
No functional changes to the crawler.
No functional changes to the crawler.
No functional changes to the crawler.
No functional changes to the crawler.
@daoudclarke
daoudclarke force-pushed the claude/funny-fermi-gi5gi0 branch 2 times, most recently from 294d21e to d5c668a Compare November 11, 2026 16:10
The commits before this one are #629's (rust_crawl) Rust work as written. This
keeps what the server uses, index.rs unchanged, and removes the rest, which stays
on rust_crawl until it has tests checking it against the Python: the crawler
binary, the blacklist and indexer modules, the copied HN domains table, and their
dependencies (tokio, reqwest, redis, anyhow). So the server's extension links only
serde_json and zstd, at mwmbl_rank's 0.13.

Rust tests for the page format: round trips, term filtering, packing to the longest
prefix that fits, and each way a page can fail to read. `make rust-core` runs them
with rustfmt and clippy, and CI runs it in the test job.

The crawler links mwmbl_core through mwmbl_rank, so a change to the page format
there needs a crawler release like a change to mwmbl_rank does: add it to
CRAWLER_DIRECTORIES.

No functional changes to the crawler.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DTbu4qHPfdk1QZ2ZSYHnn7
@daoudclarke
daoudclarke force-pushed the claude/funny-fermi-gi5gi0 branch 2 times, most recently from ce189e2 to dca2970 Compare November 11, 2026 16:14
@codecov
codecov Bot commented Nov 11, 2026
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.91304% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
mwmbl_rank/src/index.rs 66.66% 5 Missing ⚠️
mwmbl_rank/src/pipeline.rs 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Lama-Thematique
Copy link 8000
Copy Markdown
Contributor

It wouyld be nice if it kept the rest of the rust code so i don't have to reintroduce again all my commits and code.

@daoudclarke
Copy link
Copy Markdown
Contributor Author

Following @Lama-Thematique's suggestion

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.

3 participants

0