reprend #2016: runtime: guard null and invalid sizes in value_write_sink and add unit tests (RT-VALUE-WRITE-SINK-GUARDS-AND-TESTS) #2735

Merged
OreoFR merged 3 commits from upstream-pr/2735 into main 2026-11-30 17:15:17 +00:00
OreoFR commented 2026-11-30 13:39:21 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-30T13:39:21Z.


Carries #2016 by @abnalstlll-byte, because it conflicts with main after #2566 and the reminder to merge main (https://github.com/ProjectLeonida/mandy/pull/2016#issuecomment-7232609246) got no answer within the delay of the carry rule. If the author comes back, this carry is dropped.

Item: RT-VALUE-WRITE-SINK-GUARDS-AND-TESTS-CARRY (claimed in https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7280119323; original item RT-VALUE-WRITE-SINK-GUARDS-AND-TESTS).

What this branch is

  • The author's branch at 804f97479, unchanged (no rebase, author commits kept).
  • A merge of main (from the carry preparation of 29/11) that resolves the conflict, then a merge of current main f9f3ec4c6, which had a new conflict (below). Both merge commits carry Co-authored-by the author.
  • Nothing else: the change itself is the original PR's; see #2016 for what and why, and the verifications posted there.

What conflicted and how it was resolved

  • runtime/CMakeLists.txt: the PR's value_write_sink_test after main's console_heap_slot_records and shadow_keep tests.
  • New with f9f3ec4c6: runtime/CMakeLists.txt: main added the title_frames, title_mirror_hooks and title_heap tests at the same place; all kept, the PR's test after them.

Tests

  • On this branch (main f9f3ec4c6 merged), Windows 11, Python 3.12, no GPU used: C++ only: left to this PR's CI (no local C++ build in this run).
  • Earlier merge: ctest 502 tests, value_write_sink passes; red: the test does not compile on main (reset_for_test absent); big_compile_gate timed out on the loaded PC, to check on the runners.
  • python -I scripts/check_no_game_data.py on every file this PR changes: clean.
  • CI on this PR covers the rest (C++ build and ctest, the full translator suite).

Depends on: none.

Needs an independent verifier before merge (red/green on another machine), as for any carry.

AI-assisted (Claude Code, oreofr-agent).

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5566389187 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2735). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-30T13:39:21Z. --- Carries #2016 by @abnalstlll-byte, because it conflicts with `main` after #2566 and the reminder to merge `main` (https://github.com/ProjectLeonida/mandy/pull/2016#issuecomment-7232609246) got no answer within the delay of the carry rule. If the author comes back, this carry is dropped. Item: `RT-VALUE-WRITE-SINK-GUARDS-AND-TESTS-CARRY` (claimed in https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7280119323; original item `RT-VALUE-WRITE-SINK-GUARDS-AND-TESTS`). ### What this branch is - The author's branch at `804f97479`, unchanged (no rebase, author commits kept). - A merge of `main` (from the carry preparation of 29/11) that resolves the conflict, then a merge of current `main` `f9f3ec4c6`, which had a new conflict (below). Both merge commits carry `Co-authored-by` the author. - Nothing else: the change itself is the original PR's; see #2016 for what and why, and the verifications posted there. ### What conflicted and how it was resolved - `runtime/CMakeLists.txt`: the PR's `value_write_sink_test` after `main`'s `console_heap_slot_records` and `shadow_keep` tests. - New with `f9f3ec4c6`: `runtime/CMakeLists.txt`: `main` added the `title_frames`, `title_mirror_hooks` and `title_heap` tests at the same place; all kept, the PR's test after them. ### Tests - On this branch (`main` `f9f3ec4c6` merged), Windows 11, Python 3.12, no GPU used: C++ only: left to this PR's CI (no local C++ build in this run). - Earlier merge: `ctest` 502 tests, `value_write_sink` passes; red: the test does not compile on `main` (`reset_for_test` absent); `big_compile_gate` timed out on the loaded PC, to check on the runners. - `python -I scripts/check_no_game_data.py` on every file this PR changes: clean. - CI on this PR covers the rest (C++ build and `ctest`, the full translator suite). Depends on: none. **Needs an independent verifier before merge** (red/green on another machine), as for any carry. AI-assisted (Claude Code, oreofr-agent). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Kal0s-design commented 2026-11-30 14:13:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-11-30T14:13:34Z.


Independent Windows check of 30857b8b7 on current main b17b22d33 (no conflict, tree 2adaba89f). Native Windows 11, MSVC 19.50 x64. test/value_write_sink_test.cpp was built alone as its CMake target builds it, under AddressSanitizer with the debug CRT and checked iterators (/W4 /permissive- /utf-8 /Od /MDd /fsanitize=address).

  • Green: OK: value_write_sink_test passed all checks, no ASan report, 0 warnings, including the test's threads.
  • Red isn't possible as a run: this PR's test needs the hooks it adds to value_write_sink.h (reset_for_test, clear_title_pages), so against main's header it doesn't compile (C3861 on each).

I didn't read the conflict resolution line by line.

GPUs tested: n/a (CPU unit test). AI-assisted: yes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7281034732 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2735#issuecomment-7281034732). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-11-30T14:13:34Z. --- **Independent Windows check** of `30857b8b7` on current `main` `b17b22d33` (no conflict, tree `2adaba89f`). Native Windows 11, MSVC 19.50 x64. `test/value_write_sink_test.cpp` was built alone as its CMake target builds it, under AddressSanitizer with the debug CRT and checked iterators (`/W4 /permissive- /utf-8 /Od /MDd /fsanitize=address`). - Green: `OK: value_write_sink_test passed all checks`, no ASan report, 0 warnings, including the test's threads. - Red isn't possible as a run: this PR's test needs the hooks it adds to `value_write_sink.h` (`reset_for_test`, `clear_title_pages`), so against `main`'s header it doesn't compile (C3861 on each). I didn't read the conflict resolution line by line. GPUs tested: n/a (CPU unit test). AI-assisted: yes.
MoonEyes commented 2026-11-30 15:43:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T15:43:59Z.


Verified by MoonEyes (another owner than OreoFR) on head 30857b8b7 merged with main be7690805: Windows 11, MSVC 2022 x64, RelWithDebInfo, ctest -R ^value_write_sink$: 1/1 passed. No red: the test uses hooks this pull request adds to value_write_sink.h (C3861 without it). CPU unit test, no run of the title.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7283487383 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2735#issuecomment-7283487383). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-30T15:43:59Z. --- Verified by MoonEyes (another owner than OreoFR) on head `30857b8b7` merged with `main` `be7690805`: Windows 11, MSVC 2022 x64, RelWithDebInfo, `ctest -R ^value_write_sink$`: 1/1 passed. No red: the test uses hooks this pull request adds to `value_write_sink.h` (C3861 without it). CPU unit test, no run of the title. AI-assisted (Claude Code).
MoonEyes commented 2026-11-30 17:15:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T17:15:14Z.


Merging. Head 30857b8b7 merges cleanly with main 149e3835f and does not force a rebase of #2566. Unit test green on Windows 11 by two other people; no red possible (the test needs the new hooks). Merged by MoonEyes.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7285966754 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2735#issuecomment-7285966754). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-30T17:15:14Z. --- Merging. Head `30857b8b7` merges cleanly with `main` `149e3835f` and does not force a rebase of #2566. Unit test green on Windows 11 by two other people; no red possible (the test needs the new hooks). Merged by MoonEyes. AI-assisted (Claude Code).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2735
No description provided.