Skip to content

[Feature] Add the reverse pool-reset invariant: a poolReset: true modifier must be cleared on every receiver its gate admits #1017

Closed

Description

Problem

PoolResetSetConsistencyTests already enforces the pool ⇄ analyzer relationship in both directions — but only at property granularity:

  • cleared in CleanElement ⇒ marked poolReset: true — Every_Reset_Property_With_Matching_Modifier_Is_Tracked (:117)
  • marked poolReset: true ⇒ cleared somewhere in the FE-common block — Every_TrappedProperty_Is_Reset_In_CleanElement (:86), Every_TrappedAttachedProperty_Is_Reset_In_CleanElement (:185)

Important

The gap is granularity, not direction. Do not implement this as "add the missing reverse direction" — that test already exists, a new one will pass immediately, and the hole stays open.

At (property × gated receiver) granularity the invariant is one-directional:

exists  : "Padding is cleared SOMEWHERE in the FE-common block"     -> passes, via the Control|Border|Panel chain
missing : "Padding is cleared for EVERY receiver its gate admits"   -> RelativePanel is gated in, never cleared

This is also why the file's other guards cannot catch it: Every_ClearValue_In_CleanElement_Is_Recognized_By_The_Reset_Scan and Attached_Reset_Scan_Sees_Every_Owner_The_Table_Names protect the scan, and a scan that reads the block perfectly still cannot notice a receiver that was never written to.

That asymmetry makes a whole defect class structurally invisible: widen a modifier's gate (or its ApplyModifiers write) to a new receiver type without adding the matching ClearValue. Nothing fails. The analyzer starts telling users the value "is reset on pool return" for a receiver the pool never resets, and the day that receiver is added to PoolableTypes it silently leaks its previous renter's local value — which outranks every Style setter in WinUI's DP precedence order.

This is not hypothetical. It has now appeared three times:

The #985 case additionally shows the cost of the blind spot. During PR #984's development a Control/StackPanel clear block was removed in 14c8aaf4 — this was not a revert of #984, which merged intact. It was a scope narrowing, and that commit's own message says the work was "filed as a follow-up instead"; #985 is that follow-up. The stated reason for removing it was that the block "forced six modifiers from REACTOR_MOD_002 to REACTOR_POOL_001 and invalidated 27 analyzer expectations" — i.e. the existing invariants fired loudly on the marking, which is the expensive half, while the receiver-coverage gap that marking was supposed to describe stayed unmeasured. A receiver-granular invariant would have named that gap directly.

Proposed solution

Add a test alongside the existing ones in tests/Reactor.Tests/AnalyzerTests/PoolResetSetConsistencyTests.cs:

Every_PoolReset_Modifier_Is_Cleared_On_Every_Gated_Receiver

For each ModifierTable entry with poolReset: true, expand its controlGate type list to the concrete receiver types (Control, Border, Panel, Grid, StackPanel, RelativePanel, TextBlock, …) and assert the CleanElement FE-common region contains a ClearValue reaching each one — directly, or via a base type that provably covers it (a Control clear covers every Control subclass; a Panel clear covers Grid/StackPanel/RelativePanel).

Two details worth getting right, because they are what makes it non-vacuous:

  1. Subsumption must be explicit, not assumed. if (fe is Control c) genuinely covers all Control subclasses, but if (fe is StackPanel s) does not cover Grid. The test needs a small "does clear on type X satisfy gate entry Y" relation rather than a name match, or it will either miss real gaps or demand redundant clears.
  2. It must fail if the clear moves out of the scanned region. ReadCleanElementCommonBlock already delimits at the first switch (<param>); reusing it means the Fix #952: unsetting a common modifier must ClearValue, not write the DP default #984 placement mistake reddens this test too, which is the outcome we want.

Failure message should name the modifier, the gate entry that has no clear, and the file/line of the gate — so the fix is mechanical.

Alternatives considered

  • Analyzer-side check instead of a test. Wrong layer: ModifierTable is the analyzer's own data, and it can't see ElementPool.cs at analysis time.
  • Extend ModifierUnsetClearValueTests' pin list instead. That file pins an explicit receiver/property list (14 pins today, added in [Bug] ElementPool.CleanElement never releases Panel.Background, or any Control-level Padding/CornerRadius/BorderThickness/BorderBrush/Background/IsEnabled #985). Pins catch deletion of a known clear; they don't catch addition of a new gated receiver, which is precisely this bug. Complementary, not a substitute.
  • Rely on selftest fixtures. They prove a specific pooled control releases a specific property, which is valuable, but coverage is per-fixture and per-type — the gap only shows up if someone thinks to write the fixture for the new receiver, which is the same omission being guarded against.
  • Do nothing, treat it as review discipline. Three occurrences say otherwise, and the merged-tree case was invisible to both PRs' CI: disjoint file sets, clean auto-merge, both green independently.

Additional context

Confirmation

  • I have searched existing issues and specs for prior discussion of this idea.

Activity

  1. azchohfi commented on Jul 31, 2026

    @azchohfi
    CollaboratorAuthor

    Measured evidence for this, from a trial merge of #1015 with #1003 (which widens the Padding/CornerRadius gates to Grid and RelativePanel).

    Setup. In the merged tree, ApplyModifiers genuinely writes Padding/CornerRadius to Grid. I deleted the ClearValue calls that release them — they live inside case WinUI.Panel panel:, i.e. below the type dispatch that ReadCleanElementCommonBlock stops scanning at.

    mutation full headless unit suite PoolResetSetConsistencyTests alone
    clears deleted (below dispatch) 13043 passed / 0 failed 54 / 54 passed
    one clear no-op'd above the dispatch — 1 failure, named exactly

    The third row is the control condition: same tree, same build, same filter. Without it, "everything passed" is indistinguishable from a broken harness. It reddens, so the instrument was live for the first two rows too. The only variable is placement relative to the dispatch.

    Scope, stated honestly: the selftest tier does catch this case — #1003 ships Issue950Panel_Pool_NewPropertiesCleared, which goes not ok when those clears are removed. So this is a gap in the headless tier, not total blindness. That still matters, because the headless tier is where the pool ⇄ analyzer relationship is supposed to be enforced structurally rather than per-fixture.

    And the per-fixture coverage is exactly as fragile as you'd expect. The same selftest ends with:

    && IsUnset(recycledRelative, WinUI.RelativePanel.PaddingProperty)
    && IsUnset(recycledRelative, WinUI.RelativePanel.CornerRadiusProperty));

    RelativePanel isn't in PoolableTypes, so recycledRelative is a freshly constructed object (the adjacent check asserts !ReferenceEquals). Those two properties are unset by construction. Proof rather than argument: ElementPool.cs contains zero occurrences of RelativePanel — no clear exists anywhere — and the check still reports ok. It passes against no implementation at all.

    So RelativePanel reads as covered while having no pool clear, and the day someone adds it to PoolableTypes the fixture stays green and the leak goes live. A reverse invariant would report it immediately and by name, without anyone having to think to write the fixture.

    Related, and better than what I proposed above: #1003 adds ModifierTableIntegrityTests.Every_ControlGate_Matches_The_Types_ApplyModifiers_Writes_To, which enforces the forward direction (gate matches what ApplyModifiers writes) and produces an actionable message:

    CornerRadius: ModifierTable says [Border|Control] but ApplyModifiers writes to
    [Border|Control|Grid|RelativePanel|StackPanel]
    

    It caught a real mistake in my merge resolution within seconds. The invariant proposed here is the missing third leg of the same triangle — ApplyModifiers ↔ ModifierTable is now covered; ModifierTable ↔ ElementPool is not. Implementing it next to ModifierTableIntegrityTests rather than in PoolResetSetConsistencyTests may be the better home.

  2. azchohfi commented on Jul 31, 2026

    @azchohfi
    CollaboratorAuthor

    Correction to the proposal above — as written it would demand dead code, and would have failed a PR for doing the right thing.

    Surfaced while answering #1003 about whether to add a RelativePanel clear. The answer is no, and the reason invalidates part of the scope I specified.

    ElementPool.Return bails before CleanElement is ever reached:

    public void Return(FrameworkElement element)
    {
        if (!Enabled) return;
        var type = element.GetType();
        if (!PoolableTypes.Contains(type)) return;   // <-- line 124
        ...
        CleanElement(element);                        // <-- line 152
    }

    So CleanElement only ever runs on types in PoolableTypes. Two consequences for the proposed invariant:

    1. A clear for a gated-but-unpooled receiver can never execute. RelativePanel is in the Padding/CornerRadius gates (after Widen panel Padding and CornerRadius modifier gates #1003) but is not poolable, so a RelativePanel.ClearValue in CleanElement would be unreachable code. The invariant as I wrote it — cleared on every receiver its controlGate admits — would require exactly that, and would flag a correct implementation as a violation.

    2. Membership is exact-type, not assignability. PoolableTypes.Contains(element.GetType()) means a subclass of Grid or StackPanel is not pooled either.

    Corrected scope: the invariant should assert

    a property marked poolReset: true must be cleared on every receiver in controlGate ∩ PoolableTypes, matched by exact type

    Everything else in the proposal stands, including the measured evidence in the previous comment — the Grid and StackPanel cases that motivated this are both in PoolableTypes, so they remain in scope and remain uncovered by the headless tier.

    Two further notes for whoever implements it:

    • The intersection makes the invariant self-maintaining in the useful direction: adding typeof(WinUI.RelativePanel) to PoolableTypes would immediately bring it into scope and fail until a clear exists. That is precisely the day-two scenario this issue exists to catch, and the corrected form catches it without demanding dead code beforehand.
    • It also means the invariant should read PoolableTypes directly rather than hard-coding a receiver list, so the two can't drift.
  3. azchohfi commented on Aug 1, 2026

    @azchohfi
    CollaboratorAuthor

    Ownership settled: PR #1003 will implement this in its post-#1015 union.

    #1003 asked whether #1015/#1017 infrastructure should own the dynamic invariant or
    whether they should add it. Answer: theirs, and the reason is that the test
    cannot fail on #1015's tree.

    At #1015's head the border-box gates admit Control / Border / StackPanel /
    TextBlock. Every member of that set ∩ PoolableTypes is already cleared by the
    FE-common block in CleanElement and pinned in CleanElementRequiredClears. So
    landing the invariant in #1015 adds an assertion that goes green regardless — it
    only starts doing work once the gates widen to Grid/RelativePanel, which is
    #1003's change. #1003 also merges last and therefore sees the final state.

    Three implementation notes measured while answering

    1. PoolableTypes is private, not internal —
    src/Reactor/Core/ElementPool.cs:45. InternalsVisibleTo("Reactor.Tests") does not
    reach it; a runtime read needs
    GetField("PoolableTypes", BindingFlags.NonPublic | BindingFlags.Static).

    This is where the invariant's vacuity lives. If the field is renamed, GetField
    returns null → empty set → zero poolable gate types → nothing to assert → green.
    Silent, and in the reassuring direction — the same shape as a -1 sentinel satisfying
    a > comparison. The reflection lookup must throw on null-or-empty rather than
    skip. That guard is more load-bearing than the assertion it protects.

    Reading it at runtime is headless-safe: the initializer is all typeof(...) with no
    WinUI construction, so it does not trip the COMException rule in AGENTS.md.

    2. Intersect by assignability, not by gate name. The gate names Control, but
    PoolableTypes holds exact runtime types including Button (:62), TextBox (:63)
    and ToggleSwitch (:64). Those are concrete receivers of a Control gate, and no
    name-based intersection finds them. CleanElement's FE-common arm is
    fe is WinUI.Control c, so it does clear them — which is why the redundant per-arm
    IsEnabled clears could be removed in #1015. A name-based intersection would exclude
    every poolable Control subtype and shrink the invariant to almost nothing while
    still reading as correct.

    3. RelativePanel is absent from PoolableTypes (:47–64), so its arm is satisfied
    by the non-poolable branch today and flips to requiring a clear the moment anyone adds
    it. That is exactly the forward-gate behaviour this issue asks for, and it is the
    reason the set must be read at runtime rather than hardcoded.

    The mutation that proves it works — and the one that won't

    Deleting a clear reddens the static pins (three from #1003, fourteen from #1015), so a
    plain delete says nothing about whether the dynamic invariant contributes anything. The
    specificity check is to delete the clear and its static pin together — then only the
    dynamic invariant should catch it. Green there means the test is decorative.

    Same measurement shape that produced the 1 of 26 result on #1003's below-dispatch
    clears: sensitivity is cheap, specificity is the part worth reporting.

    If it is written as a source scanner rather than a runtime test, it must use the
    anchored region boundary (switchStart = Regex.Match(..., @"^\s*switch\s*\(..."))
    introduced in #1015, not the unanchored IndexOf still on main — the latter
    truncates the scanned block on any comment containing the dispatch text.

  4. azchohfi commented on Aug 1, 2026

    @azchohfi
    CollaboratorAuthor

    Correction to my previous comment: ownership moves to #1015, and the reason I gave for
    assigning it to #1003 no longer selects #1003.

    My comment above says "PR #1003 will implement this in its post-#1015 union." The
    coordinator has since fixed the merge order as #1003 first, #1015 second, so #1003
    never has a post-#1015 union — it merges into a tree that does not yet contain #1015.
    #1015 is the second lander and owns the union, so #1015 owns this.

    The reasoning in that comment was sound for the tree it described and stops applying under
    the new order. I argued the invariant cannot fail on #1015's tree because #1015's gates
    admit only Control / Border / StackPanel / TextBlock, all of which are already
    cleared. True of #1015 standalone. Under the new order, #1015's tree becomes the
    widened tree, so the property that disqualified it is gone.

    Measured: the union tree already satisfies the invariant

    Before deferring this I computed the full cross-product by hand, because "defer" is only
    safe if there is no present-tense gap.

    PoolableTypes (src/Reactor/Core/ElementPool.cs:47-64) is 15 exact types: TextBlock,
    RichTextBlock, StackPanel, Grid, Border, ScrollViewer, Canvas, Viewbox, ProgressBar,
    ProgressRing, Image, InfoBadge, Button, TextBox, ToggleSwitch.

    Padding — post-union gate Control | Border | Grid | StackPanel | RelativePanel | TextBlock:

    poolable exact type admitted via satisfied by
    Button, TextBox, ToggleSwitch, ScrollViewer, ProgressBar, ProgressRing, InfoBadge Control resetControl.ClearValue(Control.PaddingProperty)
    Border Border resetBorder arm
    Grid Grid folded resetGrid clear
    StackPanel StackPanel resetStack clear
    TextBlock TextBlock resetText arm
    Canvas, Viewbox, Image, RichTextBlock not admitted nothing required

    CornerRadius — gate Control | Border | Grid | StackPanel | RelativePanel — resolves
    identically, with StackPanel satisfied by the folded StackPanel.CornerRadius clear and
    TextBlock correctly not admitted.

    Every poolable receiver admitted by either widened gate has an above-dispatch clear, and
    RelativePanel falls to the non-poolable branch exactly as designed.
    So this invariant is
    future-proofing, not a hole-plug — there is no gap open while it is pending, and nothing
    degrades by it landing separately.

    Why a separate PR rather than inside the union

    The union already carries seven items across five files, two of which are silent semantic
    reconciliations that merge with no conflict marker. This invariant is a reflection-based
    test whose failure mode is fail-open — if GetField returns null the set is empty and
    it passes having asserted nothing. That is the shape that most needs proportionate review,
    and bundling it behind conflict-resolution review is how a fail-open invariant ships green.

    It also needs destructive mutation proof of its own, and running those on a tree that just
    changed for unrelated reasons destroys attribution of any failure.

    Still valid from the previous comment

    The three implementation notes stand unchanged and are not retracted: PoolableTypes is
    private so reflection must throw on null-or-empty rather than skip; intersection must
    be by gateType.IsAssignableFrom(poolableExactType) and never by gate name; and a source
    scanner must use the anchored region boundary from #1015, not main's unanchored IndexOf.

    The specificity mutation is refined to move a still-functional clear below the dispatch and
    remove its static pin
    — runtime behaviour stays green, so only an anchored source-scanning
    placement check can redden. A plain delete is caught by the static pins and by runtime, and
    therefore proves sensitivity without proving this test contributes anything.

    One thing to check during implementation rather than assume

    RichTextBlock is poolable, is not a TextBlock (it derives from FrameworkElement),
    and carries its own Padding DP. It is correctly outside the gate today, so ApplyModifiers
    never writes it — but it is precisely the shape this invariant exists to notice, and it
    deserves a deliberate look rather than an assumption. Canvas is the mirror case: poolable,
    a Panel, and has no Padding at all, so a future widening from the enumerated
    Grid/StackPanel/RelativePanel to a bare Panel gate should redden.

  5. azchohfi commented on Aug 1, 2026

    @azchohfi
    CollaboratorAuthor

    Verified on current main (1ed2644e), and this issue is now UNOWNED

    The latent defect described in the body is live on merged main today. Measured, with controls:

    src/Reactor/Core/ElementPool.cs            437 lines
      RelativePanel matches                      0
      CONTROL StackPanel                         6      (probe is live)
      CONTROL Grid                               4      (probe is live)
    
    src/Reactor.Analyzers/ModifierTable.cs     610 lines
      :227  ControlBorderGridStackRelativeText = { "Control","Border","Grid","StackPanel","RelativePanel","TextBlock" }
      :228  ControlBorderGridStackRelative     = { "Control","Border","Grid","StackPanel","RelativePanel" }
    
    ElementPool.PoolableTypes: RelativePanel ABSENT
      (TextBlock · RichTextBlock · StackPanel · Grid · Border · ScrollViewer · Canvas ·
       Viewbox · ProgressBar · ProgressRing · Image · InfoBadge · …)
    

    **RelativePanel IS admitted by the Padding/CornerRadius modifier gates, and ElementPool has

    ZERO clears for it. The only thing keeping it latent is that RelativePanel is not in

    PoolableTypes.**

    The arming change is one line. Adding typeof(WinUI.RelativePanel) to PoolableTypes is an
    innocuous-looking enablement that would silently make Padding/CornerRadius leak across rent/return for
    that type — with no failing test, because the invariant that would catch it is the one this issue exists to
    add.

    Ownership

    Nothing is currently implementing this. Measured:

    open PRs scanned                  19
    open PRs referencing #1017         0
    CONTROL: open PRs saying "Fixes #" 12      (the scan works)
    

    #1003 — which was expected to pick this up "post-#1015" — merged at 2026-08-01T05:37:12Z (state=closed merged=true, merge commit 1ed2644e). Its branch now reads ahead_by=0, so there is no PR left to carry
    the work.

    This needs a new owner. The spec in the body is intact and is the good one — per (modifier × concrete
    poolable receiver admitted by its gate)
    , assignability-resolved, reflection on private PoolableTypes
    throwing on missing/empty (else a rename yields an empty set and every quantifier passes vacuously),
    plus a specificity mutation that removes the clear and its static pin so only the new invariant reddens.

    And the warning already in the body still applies and is the important part:

    The gap is granularity, not direction. Do not implement this as "add the missing reverse direction" —
    that test already exists, a new one will pass immediately, and the hole stays open.

    No merge is being requested or performed.

  6. azchohfi commented on Aug 1, 2026

    @azchohfi
    CollaboratorAuthor

    Follow-up from #1015's final audit — two things that materially change how this test should be written, both found after filing.

    1. There is a third condition, and the proposal above is missing it

    The proposal quantifies over (modifier × gated receiver). That is one condition short. A gated receiver needs a CleanElement arm only if the property is written by a path that does not self-heal on pool reuse — and Reactor has three write paths with three different obligations:

    write path self-clears stale local value at mount? needs a CleanElement arm?
    descriptor OneWay(get, set, dp:) yes no
    generic modifier chain (ApplyModifiers) no yes — this is #985
    .Set(x => ...) escape hatch no yes — this is #1039

    The self-healing one is OneWayClearValuePropEntry.Mount, src/Reactor/Core/V1Protocol/Descriptor/PropEntry.cs:128-141:

    var vOpt = _get(el);
    if (vOpt.HasValue)
        _set(ctrl, vOpt.Value);
    else if (!ReferenceEquals(ctrl.ReadLocalValue(_dp), DependencyProperty.UnsetValue))
        ctrl.ClearValue(_dp);   // a pooled control carrying a stale local value lands here

    A rented control carrying the previous renter's local value hits that else if and is cleared at mount, so no pool arm is required.

    A concrete case that looks exactly like the bug and is not one: RichTextBlock is in PoolableTypes (ElementPool.cs:48), its Padding is written (Element.cs:2751-2759, descriptor OneWay with dp: WinUI.RichTextBlock.PaddingProperty), and CleanElement has no RichTextBlock arm. That is the #985 shape in every visible respect, and it is correct as-is.

    It is not reachable through today's gates — Padding's gate is {Control, Border, Grid, StackPanel, RelativePanel, TextBlock} and does not admit RichTextBlock — so a gate-quantified test is safe today. It stops being safe the moment a descriptor-bound receiver is added to a gate, and the resulting failure would demand a redundant ClearValue while reading as a genuine leak. Worth encoding the exclusion with its reason rather than discovering it under time pressure.

    Note this also sharpens the RelativePanel case already described above. RelativePanel needs no arm for a different reason — not in PoolableTypes — and the two reasons are independent. Whichever policy is chosen (clear defensively, or exclude with a reason), the test should distinguish "not poolable" from "self-healing write path", because they fail differently when the world changes: adding RelativePanel to PoolableTypes creates a real leak, whereas a descriptor-bound property never does.

    2. The expected set, so the new test has a known-answer case

    An implementer has no way today to tell a correct new test from a plausible one. Here is the required set derived from source, independent of any test — (modifier write-chain receivers) ∩ (reachable from PoolableTypes):

    property modifier write chain source required receivers
    Padding Control, Border, StackPanel, Grid, RelativePanel, TextBlock Reconciler.cs:3752-3757 5 (RelativePanel not poolable)
    CornerRadius Control, Border, Grid, StackPanel, RelativePanel :3867-3871 4
    BorderThickness Control, Border :3912-3913 2
    BorderBrush Control, Border :3885-3886, :3393-3394 2
    Background Panel, Control, Border :3924-3926 3
    IsEnabled Control :3859-3862 1
    17

    CleanElement after #985 contains exactly 17 ClearValue calls — Control 6, Border 5, Panel 1, Grid 2, StackPanel 2, TextBlock 1 — and the two sets agree by membership, per receiver:

    Control  {Padding, CornerRadius, BorderThickness, BorderBrush, Background, IsEnabled}   6 == 6
    Border   {Padding, CornerRadius, BorderThickness, BorderBrush, Background}              5 == 5
    Panel    {Background}                                                                   1 == 1
    Grid     {Padding, CornerRadius}                                                        2 == 2
    Stack    {Padding, CornerRadius}                                                        2 == 2
    Text     {Padding}                                                                      1 == 1
    

    Compare by membership, not by count. 17 == 17 with different members is exactly the failure this issue exists to prevent, and a new test that reports the right total while pairing the wrong receivers would look verified.

    Chain ordering does not affect this: Panel, Control, Border and TextBlock are mutually disjoint WinUI types, so the write chain (Panel-first, :3924) and the clear chain (Control-first, ElementPool.cs:294) partition the same space. Every arm is reachable by at least one concrete poolable type — the Control arm via Button/TextBox/ScrollViewer/ProgressBar/ProgressRing/ToggleSwitch/InfoBadge, the Panel arm via Canvas in addition to Grid/StackPanel.

    Two caveats on that table, stated so it is not over-read:

  7. azchohfi commented on Aug 1, 2026

    @azchohfi
    CollaboratorAuthor

    Ownership resolved — and three pieces of reasoning worth keeping from how it was decided

    This issue now has an owner (the #985 / ElementPool session), to be implemented as a separate PR
    against a settled main
    rather than folded into a pending union. The premise recorded earlier on this
    issue has been independently re-verified at head:

    PoolableTypes (15): TextBlock · RichTextBlock · StackPanel · Grid · Border · ScrollViewer · Canvas ·
                        Viewbox · ProgressBar · ProgressRing · Image · InfoBadge · Button · TextBox · ToggleSwitch
    
    Padding gate: { Control, Border, Grid, StackPanel, RelativePanel, TextBlock }
    
    RichTextBlock  poolable TRUE · in the Padding gate NO · has its own Padding DP
    Canvas         poolable TRUE · is a Panel · has NO Padding DP at all
    RelativePanel  in the gate  · NOT poolable · zero ElementPool clears
    

    RichTextBlock is RelativePanel's mirror image — poolable but ungated, so nothing writes it today.
    Canvas is the other mirror: any future widening from the enumerated panels to a bare Panel gate
    should redden. (Note RichTextBlock appears 24 times in ModifierTable — it is gated for other modifiers.
    A bare "is it in the table?" check would say yes and be useless.)

    1. Why a fail-open invariant must not ride in a conflict resolution

    **"This invariant's failure mode is FAIL-OPEN — GetField returns null, the set is empty, it passes

    having asserted nothing. Putting it behind conflict-resolution review is how a fail-open invariant

    ships green."**

    The argument is not about scope. A fail-open guard needs more scrutiny than the code it guards, and
    conflict review is the one context where reviewers read for "did the merge preserve both sides?" rather
    than "does this assert anything?"

    "Mutating a tree that just changed for unrelated reasons destroys attribution."

    Which is why the destructive probe — rename PoolableTypes and prove the test THROWS rather than skips —
    has to run on a settled tree.

    2. Measuring whether deferral costs anything, BEFORE deferring

    A full cross-product of the 15 poolable types against both post-union gates established that the invariant
    passes on the union tree — it is future-proofing, not a hole-plug, and no window opens while it is pending.

    "Leave it for later" is only safe if you have checked that nothing is open in the meantime — and

    that check is almost never run, because deferral feels like the conservative option by default.

    3. A corrected position that lived in more places than the conversation

    The same session had previously published a comment on this issue assigning the work elsewhere, on
    reasoning that was sound under one merge order and stopped applying under another. They went looking for it
    rather than waiting to be told
    , and corrected it with the reasoning made explicit rather than quietly
    edited
    .

    **A silent edit leaves the next reader unable to tell whether the original was WRONG or the WORLD

    MOVED** — and those have different implications for everything else that cited it.

  8. azchohfi commented on Aug 1, 2026

    @azchohfi
    CollaboratorAuthor

    Correction to the parenthetical count in my previous comment — and a refinement it exposed

    The number was wrong at every basis. I wrote "RichTextBlock appears 24 times in ModifierTable":

    src/Reactor.Analyzers/ModifierTable.cs      substring   quoted "RichTextBlock"
    origin/main                                     26              0
    5d78f70e  (the basis it was measured on)        26              0
    89f2bdd2  (current #1015 head)                  27              1
    

    The conclusion it supported is unaffected and stands — RichTextBlock is gated for other modifiers, so a
    bare "is it in the table?" check would indeed say yes and be useless.

    ⭐ But verifying it, my own probe nearly inverted the lesson

    I re-checked using the exact quoted literal "RichTextBlock" — the form that is correct for fixture-registry
    rows, where a substring match lets a shorter name inherit a longer name's hits. On main it returns 0, which
    reads as "RichTextBlock is in no gate at all" — the opposite of the recorded finding, and I was one step from
    filing it as a correction.

    It is in two gates, on both refs. The gates name Element types, not control types:

    RichTextBlockOnly    = { "RichTextBlockElement" }
    TextOrRichTextBlock  = { "TextBlockElement", "RichTextBlockElement" }
    gates containing RichTextBlock:  main = 2    head = 2      (neg ctl: gates containing Control = 5 / 7)
    

    The single quoted "RichTextBlock" at :317 on the #1015 head is the PoolableTypeNameSet mirror, not a
    gate — which is why the count moves 26 → 27 on that branch and not before.

    The two matching modes are duals, and neither is universally right:

    - substring: X inherits hits belonging to XSuffix → false PRESENT

    - exact-quoted: X misses XSuffix entirely → false ABSENT

    So "always match the exact quoted literal" is incomplete. It needs "…in the vocabulary the file actually
    uses"
    — full names for registry rows, …Element-suffixed names for modifier gates. Both failures present as a
    well-formed, plausible answer; the exact-quoted one presents as a confident zero, which is the harder of the
    two to doubt because it looks like a clean negative result rather than a broken probe.

  9. azchohfi commented on Nov 13, 2026

    @azchohfi
    CollaboratorAuthor

    #1015 added this as Every_Poolable_Gated_Receiver_Is_Released_By_CleanElement in ModifierUnsetClearValueTests. It matches receivers by type inheritance instead of by name, and it fails if the PoolableTypes set can't be read or comes back empty, so it can't pass vacuously. Closing.

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions