leonida-gpu: whole records for the fallback's pages, straddlers on their own #3477

Merged
leonida/mandy
MoonEyes merged 8 commits from fix/port-descriptors-record-parts into main 2026-12-04 15:17:27 +00:00

Pull request successfully merged and closed

Member

Commits:

  • leonida-gpu: whole records for the fallback's pages, straddlers on their own
  • leonida-gpu: pin the shared straddler, and say why pages stay apart
  • leonida-gpu: say that the fallback's pages are aligned
  • leonida-gpu: one page split for the fallback's pages and a written range's records
  • leonida-gpu: the page split's run end no longer shadows the heap's end

2 files changed, 130 insertions(+), 25 deletions(-).

Tested:

  • cargo test --locked -p leonida-gpu -p leonida -p leonida-hle -p leonida-shader: 1 621 passed, 0 failed (all branches of this batch together, test/lot-gxdk-0412 @ 229b1e1a8f).
  • In-game gate, RTX 4060, driver 32.0.16.1088, -SeriesS -PrecompileUsed, run lot3b-sansnatif: PASS, 325 s in the world, no device loss, longest present gap 0.7 s, median 15.2 fps (main: 14.4).

AI-assisted: Freebuff (ultra), reviewed by Claude Opus 5.5. Merged by Moon's agent on Moon's written authorization (two maintainers).

🤖 Generated with Claude Code

Commits: - leonida-gpu: whole records for the fallback's pages, straddlers on their own - leonida-gpu: pin the shared straddler, and say why pages stay apart - leonida-gpu: say that the fallback's pages are aligned - leonida-gpu: one page split for the fallback's pages and a written range's records - leonida-gpu: the page split's run end no longer shadows the heap's end 2 files changed, 130 insertions(+), 25 deletions(-). Tested: - `cargo test --locked -p leonida-gpu -p leonida -p leonida-hle -p leonida-shader`: 1 621 passed, 0 failed (all branches of this batch together, test/lot-gxdk-0412 @ 229b1e1a8f). - In-game gate, RTX 4060, driver 32.0.16.1088, -SeriesS -PrecompileUsed, run lot3b-sansnatif: PASS, 325 s in the world, no device loss, longest present gap 0.7 s, median 15.2 fps (main: 14.4). AI-assisted: Freebuff (ultra), reviewed by Claude Opus 5.5. Merged by Moon's agent on Moon's written authorization (two maintainers). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
`port_descriptors::plan_parts` took a fallback page's first record as the
first one to *begin* in it (`div_ceil`). A heap whose start is not a multiple
of its record size has a record across the page's start; when a write touched
only that record's second half, on the watched page, the read started at the
next record and the write was never seen. The record is now read whole.

As in the descriptor sync's `sync_record_parts` (#3445), a page's part is made
of whole records, a record across either end of the page is a part of its own
(so a page that cannot be read does not take its neighbour's records with it),
and parts that hold the same records are merged into one.

The new test, a heap 16 bytes into a page with 32-byte records and only the
page holding the second half of the straddling record, fails on the old code:
one part from the next record on (2097168..2162704) against the straddler
(2097136..2097168) and the two page parts.

`cargo test -p leonida-gpu --locked`: 739 passed, 0 failed, 60 ignored.
`cargo clippy -p leonida-gpu --locked --all-targets`: no findings.
`check_no_game_data.py` on the file: clean.

AI-assisted (Freebuff, Buffy)
The merge rule that keeps a page's part from swallowing an adjacent one is
the half of the change that keeps a read from crossing a page boundary again;
its comment now says so.

The test also covers two pages that both hold the record across their
boundary: one part for it, once.

`cargo test -p leonida-gpu --locked`: 739 passed, 0 failed, 60 ignored.
`cargo clippy -p leonida-gpu --locked --all-targets`: no findings.

AI-assisted (Freebuff, Buffy)
`plan_parts` splits a page with `at % page_size`, which puts the split at
the page's own ends only for pages aligned on `page_size`; the watch's pages
are, and the doc now says so. No behaviour change.

`cargo test -p leonida-gpu --locked`: 739 passed, 0 failed, 60 ignored.
`cargo clippy -p leonida-gpu --locked --all-targets`: no findings.

AI-assisted (Freebuff, Buffy)
`plan_parts`'s page loop and `sync_record_parts`'s were the same split: a slot
range cut where a watch page ends, a record across its end alone in its run.
Both now call one function, `port_descriptors::each_page_run`; the formula, the
slot and byte mapping and the `check` flag are unchanged on either side.

The test the reviewer asked for: `plan_parts`'s parts on a heap 16 bytes into
a page with 32-byte records, fed to the read loop's `part_records` — each part
starts on a record and holds whole ones, and the record across a page's start
is one part, both halves.

`cargo clippy -p leonida-gpu --locked --all-targets -- -D warnings`: exit 0.
`cargo test -p leonida-gpu --locked`: 757 passed, 0 failed, 60 ignored.

AI-assisted (Freebuff, Buffy)
In `plan_parts`, the closure parameter was named `end`, hiding the `end` the
function was given (the heap's end) for the three lines of the callback; it is
`run_end` now. Nothing else changed.

`cargo clippy -p leonida-gpu --locked --all-targets -- -D warnings`: exit 0.
`cargo test -p leonida-gpu --locked`: 757 passed, 0 failed, 60 ignored.

AI-assisted (Freebuff, Buffy)
Author
Member

Merged by Moon's agent on Moon's written authorization ("Fusionne toi car on est que deux maintener"). Tested as part of test/lot-gxdk-0412: cargo tests green, in-game gate PASS (lot3b-sansnatif). Merged head 9a08f1a7c6 (main brought in with an update merge).

Merged by Moon's agent on Moon's written authorization ("Fusionne toi car on est que deux maintener"). Tested as part of test/lot-gxdk-0412: cargo tests green, in-game gate PASS (lot3b-sansnatif). Merged head 9a08f1a7c6 (main brought in with an update merge).
Sign in to join this conversation.
No description provided.