Skip to content

[pulse] pin the container unlink paths that need no model - #2355

Open
VladimirMakaev wants to merge 1 commit into
meta:mainfrom
VladimirMakaev:cut-container-unlink-1202b
Open

VladimirMakaev wants to merge 1 commit into
meta:mainfrom
VladimirMakaev:cut-container-unlink-1202b

Conversation

@VladimirMakaev

Copy link
Copy Markdown
Contributor

pop_front and pop_back needed a model because unlinking a node writes the node's successor
through the node's own back link, which cannot be related to the sentinel. The other paths that
unlink do not have that problem, and the point of these tests is that they must not grow it.

remove and unique unlink by splicing, so no successor is written through a node's own back
link. The matched nodes are spliced into a local list and destroyed when it goes out of scope, so
what these cases rest on is the absence of that write, not the survival of the elements. A forward
list is singly linked, so removing its head writes the sentinel's own field instead of going
through a back pointer, and the shape cannot arise at all.

Each case holds a reference across the call, or calls twice, so a model that invalidated the
elements rather than the one element that goes would make them report. Checked by modelling
remove as a pop: list_ref_across_remove_ok reports, and goes quiet again when that is undone.

unique and resize are unconditionally safe: unique keeps the first of each run and
resize(4) only erases from the tail, so the front always survives. The rest are silent for a
plainer reason than a precondition that never fires: nothing models remove, remove_if or
forward_list, so no finding arises on those paths at all, latent or manifest. The suite runs
with --pulse-report-issues-for-tests, whose latent channel is live and already carries latent
expectations, and these cases are silent under it. The forward-list cases are forward-looking
pins: nothing models forward_list today, so they cannot be falsified until something does.

Test plan

Ran the four C++ Pulse suites that compile this file, on this commit applied to current main:
direct_cpp_pulse_test, direct_cpp_pulse-11_test, direct_cpp_pulse-17_test and
direct_cpp_pulse-20_test. All four pass and no expectation file changed, which is the
property these cases exist to pin: they are silent today and must stay silent.

`pop_front` and `pop_back` needed a model because unlinking a node writes the node's successor
through the node's own back link, which cannot be related to the sentinel. The other paths that
unlink do not have that problem, and the point of these tests is that they must not grow it.

`remove` and `unique` unlink by splicing, so no successor is written through a node's own back
link. The matched nodes are spliced into a local list and destroyed when it goes out of scope, so
what these cases rest on is the absence of that write, not the survival of the elements. A forward
list is singly linked, so removing its head writes the sentinel's own field instead of going
through a back pointer, and the shape cannot arise at all.

Each case holds a reference across the call, or calls twice, so a model that invalidated the
elements rather than the one element that goes would make them report. Checked by modelling
`remove` as a pop: `list_ref_across_remove_ok` reports, and goes quiet again when that is undone.

`unique` and `resize` are unconditionally safe: `unique` keeps the first of each run and
`resize(4)` only erases from the tail, so the front always survives. The rest are silent for a
plainer reason than a precondition that never fires: nothing models `remove`, `remove_if` or
`forward_list`, so no finding arises on those paths at all, latent or manifest. The suite runs
with `--pulse-report-issues-for-tests`, whose latent channel is live and already carries latent
expectations, and these cases are silent under it. The forward-list cases are forward-looking
pins: nothing models `forward_list` today, so they cannot be falsified until something does.

## Test plan
Ran the four C++ Pulse suites that compile this file, on this commit applied to current main:
`direct_cpp_pulse_test`, `direct_cpp_pulse-11_test`, `direct_cpp_pulse-17_test` and
`direct_cpp_pulse-20_test`. All four pass and no expectation file changed, which is the
property these cases exist to pin: they are silent today and must stay silent.
@meta-cla meta-cla Bot added the CLA Signed label Dec 2, 2026
@VladimirMakaev
VladimirMakaev marked this pull request as ready for review December 2, 2026 15:41

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant