Forget the views a test unmaps in drop_views #382

Closed
hamdanpor-ctrl wants to merge 656 commits from upstream-pr/382 into main
hamdanpor-ctrl commented 2026-11-27 21:36:41 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by hamdanpor-ctrl on 2026-11-27T21:36:41Z.


Addresses #354.

drop_views told the guard of each view with title_memory_remapped and then unmapped it, so VIEWS kept those blocks as views. A later test that got the same addresses from VirtualAlloc for private, write-watched memory then had its range refused by ask_once (refused_as_view), nothing was kept, and asked() / prepare_raw_copy_note() answered None.

drop_views now calls title_memory_unmapping before unmapping, as the runtime and the other unmapping tests do, which forgets the views. One line, tests only.

How it was found: with a temporary eprintln! in ask_rest (not in this PR), every one of 8 failures of the two raw-copy tests on 1d83085 showed the test's fresh allocation skipped with published=false view=true.

cargo test -p victory-gpu --locked, parallel Runs Failed
1d83085 50 30 (raw-copy tests)
1d83085 + this change 10 1 (raw_title_copy_keeps_write_watch_and_resends_equal_bytes)
main at 2d97073 10 1
this branch on 0148258 40 0 (527 passed each)

So most of it is this; the one remaining failure on 1d83085 suggests a second, rarer source I have not found. Clippy with and without --all-features is clean, and cargo test -p victory-gpu --all-features --locked -- --test-threads=1 passes.

RTX 3050 Laptop GPU 4 GB (driver 617.42), i7-12700H, 16 GB, Windows 11 Pro, Rust 1.98.1.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5533388502 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/382). Originally posted by [hamdanpor-ctrl](https://github.com/hamdanpor-ctrl) on 2026-11-27T21:36:41Z. --- Addresses #354. `drop_views` told the guard of each view with `title_memory_remapped` and then unmapped it, so `VIEWS` kept those blocks as views. A later test that got the same addresses from `VirtualAlloc` for private, write-watched memory then had its range refused by `ask_once` (`refused_as_view`), nothing was kept, and `asked()` / `prepare_raw_copy_note()` answered `None`. `drop_views` now calls `title_memory_unmapping` before unmapping, as the runtime and the other unmapping tests do, which forgets the views. One line, tests only. How it was found: with a temporary `eprintln!` in `ask_rest` (not in this PR), every one of 8 failures of the two raw-copy tests on `1d83085` showed the test's fresh allocation skipped with `published=false view=true`. | `cargo test -p victory-gpu --locked`, parallel | Runs | Failed | |---|---:|---:| | `1d83085` | 50 | 30 (raw-copy tests) | | `1d83085` + this change | 10 | 1 (`raw_title_copy_keeps_write_watch_and_resends_equal_bytes`) | | `main` at `2d97073` | 10 | 1 | | this branch on `0148258` | 40 | 0 (527 passed each) | So most of it is this; the one remaining failure on `1d83085` suggests a second, rarer source I have not found. Clippy with and without `--all-features` is clean, and `cargo test -p victory-gpu --all-features --locked -- --test-threads=1` passes. RTX 3050 Laptop GPU 4 GB (driver 617.42), i7-12700H, 16 GB, Windows 11 Pro, Rust 1.98.1. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
hamdanpor-ctrl commented 2026-11-27 21:57:44 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by hamdanpor-ctrl on 2026-11-27T21:57:44Z.


More runs on 1d83085 with this change applied (cargo test -p victory-gpu --locked, parallel): 2 failures in 50 runs in total (1 of 10, 1 of 20, 0 of 20), against 30 of 50 without it.

The one leftover failure I could catch was raw_title_copy_keeps_write_watch_and_resends_equal_bytes with its range skipped as a view as well (VIEWS set, PROTECTED not), so some other path still leaves a VIEWS bit on freed memory, much more rarely. A probe recording which thread sets VIEWS in guard() changed the timing enough that it did not fail in 20 runs, so I don't have its source yet.

AI-assisted (Claude Code).

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7228906438 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/382#issuecomment-7228906438). Originally posted by [hamdanpor-ctrl](https://github.com/hamdanpor-ctrl) on 2026-11-27T21:57:44Z. --- More runs on `1d83085` with this change applied (`cargo test -p victory-gpu --locked`, parallel): 2 failures in 50 runs in total (1 of 10, 1 of 20, 0 of 20), against 30 of 50 without it. The one leftover failure I could catch was `raw_title_copy_keeps_write_watch_and_resends_equal_bytes` with its range skipped as a view as well (`VIEWS` set, `PROTECTED` not), so some other path still leaves a `VIEWS` bit on freed memory, much more rarely. A probe recording which thread sets `VIEWS` in `guard()` changed the timing enough that it did not fail in 20 runs, so I don't have its source yet. AI-assisted (Claude Code).
hamdanpor-ctrl commented 2026-11-27 21:58:32 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by hamdanpor-ctrl on 2026-11-27T21:58:32Z.


The failing default-tests job is host::refresh_tests::unchanged_ranges_are_known (host.rs:13136, "view false: written at its end"). It holds one_asking_test(), and its view = false half uses fresh private write-watched memory from title(8 * PAGE, false), the same situation as the two raw-copy tests, so it looks like the rarer leftover I mentioned above (a VIEWS bit still set on a reused address) rather than something this change adds. This branch passed it in all 40 parallel runs of cargo test -p victory-gpu --locked here, and the diagnostics job passed. Could you re-run the failed jobs?

AI-assisted (Claude Code).

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7228917657 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/382#issuecomment-7228917657). Originally posted by [hamdanpor-ctrl](https://github.com/hamdanpor-ctrl) on 2026-11-27T21:58:32Z. --- The failing default-tests job is `host::refresh_tests::unchanged_ranges_are_known` (`host.rs:13136`, "view false: written at its end"). It holds `one_asking_test()`, and its `view = false` half uses fresh private write-watched memory from `title(8 * PAGE, false)`, the same situation as the two raw-copy tests, so it looks like the rarer leftover I mentioned above (a `VIEWS` bit still set on a reused address) rather than something this change adds. This branch passed it in all 40 parallel runs of `cargo test -p victory-gpu --locked` here, and the diagnostics job passed. Could you re-run the failed jobs? AI-assisted (Claude Code).
akimfomin commented 2026-11-28 00:38:18 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by akimfomin on 2026-11-28T00:38:18Z.


PortBridge checked ea55797 on current main fe7c6e5 and with #379. Both Git comparisons are clean. The remaining 2/50 raw-copy failures are a separate test question.

A deterministic control would reserve a test-owned address, register and release a view at that address, then reserve the same address as private write-watched memory before calling ask_once. An unmapping hook omitted by mutation should leave view=true and the test should fail. Keep a distinct active-alias case where the address is still a view and must stay refused. That distinguishes a stale VIEWS entry from an overly broad clear without another 50 scheduling-dependent runs. The victory-fork #1496 placed-page fixture is a complementary control for preserving a genuine later write, not the same bug. PortBridge evidence.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7231073087 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/382#issuecomment-7231073087). Originally posted by [akimfomin](https://github.com/akimfomin) on 2026-11-28T00:38:18Z. --- PortBridge checked `ea55797` on [current main `fe7c6e5`](https://github.com/TaynanGT/Vice-Tay/commit/fe7c6e52198f2070805ffafc4e55a7163291bad0) and with [#379](https://github.com/TaynanGT/Vice-Tay/pull/379). Both Git comparisons are clean. The remaining 2/50 raw-copy failures are a separate test question. A deterministic control would reserve a test-owned address, register and release a view at that address, then reserve the same address as private write-watched memory before calling `ask_once`. An unmapping hook omitted by mutation should leave `view=true` and the test should fail. Keep a distinct active-alias case where the address is still a view and must stay refused. That distinguishes a stale `VIEWS` entry from an overly broad clear without another 50 scheduling-dependent runs. The [victory-fork #1496 placed-page fixture](https://github.com/fxceless/victory-fork/pull/1496) is a complementary control for preserving a genuine later write, not the same bug. [PortBridge evidence](https://github.com/akimfomin/PortBridge/blob/589c62c5db98b8d893885ab46cf97f56ac4b5ea0/audit/evidence/decision-followthrough/parallel-ops-2026-11-28/README.md).
TaynanGT commented 2026-11-29 11:37:40 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T11:37:40Z.


Thanks for the clean merge comparison and proposed deterministic fixture. The stale view and genuinely active alias need opposite expected outcomes. Please keep the mutation control and use a test-owned address, so the remaining parallel failures are investigated without depending only on scheduling.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7255240504 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/382#issuecomment-7255240504). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-29T11:37:40Z. --- Thanks for the clean merge comparison and proposed deterministic fixture. The stale view and genuinely active alias need opposite expected outcomes. Please keep the mutation control and use a test-owned address, so the remaining parallel failures are investigated without depending only on scheduling.
TaynanGT commented 2026-11-30 17:10:35 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-30T17:10:35Z.


main has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current main and open a new PR; I'll review it there.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7285838339 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/382#issuecomment-7285838339). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-30T17:10:35Z. --- `main` has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current `main` and open a new PR; I'll review it there.

Pull request closed

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
TaynanGT/Vice-Tay!382
No description provided.