{"id":"streaming-boundary-handling-robust-in-practice","text":"Streaming's structural boundary handling produces correct results for all observed boundary inputs: sentinel initialization handles empty/degenerate inputs without special-case code, and sentinel values never collide with valid data under LeetCode's constraints — making the paradigm empirically robust at boundaries, not just structurally sound.","truth_value":"IN","source":"","source_url":"","source_hash":"","justifications":[{"type":"SL","antecedents":["streaming-boundary-handling-structurally-complete","sentinel-defaults-safe-under-constraints"],"outlist":["rook-position-default-zero","pillow-holder-n1-crash"],"label":"One antecedent establishes structural completeness of boundary handling, the other establishes sentinel safety under constraints; the combination claims empirical robustness, which is invalidated if sentinel collision occurs (rook) or degenerate input crashes (pillow n=1)"}],"dependents":[],"metadata":{"source_type":"derived","last_reviewed":"2026-06-07T22:02:22","review_result":"pass"},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"streaming-boundary-handling-robust-in-practice","truth_value":"IN","reason":"SL justification valid","antecedents":["streaming-boundary-handling-structurally-complete","sentinel-defaults-safe-under-constraints"],"label":"One antecedent establishes structural completeness of boundary handling, the other establishes sentinel safety under constraints; the combination claims empirical robustness, which is invalidated if sentinel collision occurs (rook) or degenerate input crashes (pillow n=1)","outlist":["rook-position-default-zero","pillow-holder-n1-crash"]},{"node":"streaming-boundary-handling-structurally-complete","truth_value":"IN","reason":"SL justification valid","antecedents":["early-exit-and-sentinel-jointly-eliminate-boundary-code","single-pass-streaming-dominant-shape"],"label":"Sentinel+early-exit eliminate boundary code (depth-2) and streaming is the dominant shape (depth-2); together they show streaming's boundary handling is complete — no boundary requires explicit conditional logic"},{"node":"early-exit-and-sentinel-jointly-eliminate-boundary-code","truth_value":"IN","reason":"SL justification valid","antecedents":["early-exit-optimizations-pervasive","sentinel-initialization-encodes-boundary-conditions"],"label":"both eliminate boundary code but from opposite ends of computation; combining reveals the core loop body is free of all boundary logic"},{"node":"early-exit-optimizations-pervasive","truth_value":"IN","reason":"SL justification valid","antecedents":["three-consecutive-odds-early-exit","path-crossing-early-exit","isomorphic-early-return","first-violation-sufficiency"],"label":"Early exit is the default control flow strategy, not an optimization afterthought"},{"node":"three-consecutive-odds-early-exit","truth_value":"IN","reason":"premise"},{"node":"path-crossing-early-exit","truth_value":"IN","reason":"premise"},{"node":"isomorphic-early-return","truth_value":"IN","reason":"premise"},{"node":"first-violation-sufficiency","truth_value":"IN","reason":"premise"},{"node":"sentinel-initialization-encodes-boundary-conditions","truth_value":"IN","reason":"SL justification valid","antecedents":["ascending-check-uses-sentinel-minus-one","k-length-apart-sentinel-minus-one","prev-zero-sentinel","getheight-sentinel-neg1"],"label":"all four use domain-specific sentinels (-1 for \"no previous index\", 0 for \"no previous group\", -1 for \"any subtree unbalanced\") that make the first loop iteration produce the correct vacuous result without an explicit guard"},{"node":"ascending-check-uses-sentinel-minus-one","truth_value":"IN","reason":"premise"},{"node":"k-length-apart-sentinel-minus-one","truth_value":"IN","reason":"premise"},{"node":"prev-zero-sentinel","truth_value":"IN","reason":"premise"},{"node":"getheight-sentinel-neg1","truth_value":"IN","reason":"premise"},{"node":"single-pass-streaming-dominant-shape","truth_value":"IN","reason":"SL justification valid","antecedents":["early-exit-optimizations-pervasive","o1-space-via-running-accumulators","extend-or-reset-canonical-consecutive-pattern"],"label":"these three patterns compose into a unified streaming shape — accumulators provide O(1) state, extend-or-reset handles consecutive-element logic, and early-exit bounds work to the minimum needed"},{"node":"o1-space-via-running-accumulators","truth_value":"IN","reason":"SL justification valid","antecedents":["highest-altitude-single-pass","longest-task-single-pass-o1-space","iterative-reversal-O1-space","min-tracking-pattern-shared"],"label":"Running accumulators trade re-traversal impossibility for constant memory across streaming-style problems"},{"node":"highest-altitude-single-pass","truth_value":"IN","reason":"premise"},{"node":"longest-task-single-pass-o1-space","truth_value":"IN","reason":"premise"},{"node":"iterative-reversal-O1-space","truth_value":"IN","reason":"premise"},{"node":"min-tracking-pattern-shared","truth_value":"IN","reason":"premise"},{"node":"extend-or-reset-canonical-consecutive-pattern","truth_value":"IN","reason":"SL justification valid","antecedents":["extend-or-reset-pattern","maxpower-eager-max-update","no-post-loop-fixup-needed"],"label":"Run-tracking with eager max avoids off-by-one errors that end-of-array special cases introduce"},{"node":"extend-or-reset-pattern","truth_value":"IN","reason":"premise"},{"node":"maxpower-eager-max-update","truth_value":"IN","reason":"premise"},{"node":"no-post-loop-fixup-needed","truth_value":"IN","reason":"premise"},{"node":"sentinel-defaults-safe-under-constraints","truth_value":"IN","reason":"SL justification valid","antecedents":["sentinel-initialization-encodes-boundary-conditions","no-validation-is-deliberate-contract"],"label":"Sentinel safety depends on constraints excluding the sentinel value from valid inputs — rook defaulting to (0,0) shows this breaks when the sentinel IS a valid position","outlist":["rook-position-default-zero"]},{"node":"no-validation-is-deliberate-contract","truth_value":"IN","reason":"SL justification valid","antecedents":["solutions-no-input-validation","no-input-validation-convention","solutions-trust-leetcode-preconditions","leetcode-solutions-no-validation-convention"],"label":"Validation omission is a consistent design decision, not accumulated technical debt"},{"node":"solutions-no-input-validation","truth_value":"IN","reason":"premise"},{"node":"no-input-validation-convention","truth_value":"IN","reason":"premise"},{"node":"solutions-trust-leetcode-preconditions","truth_value":"IN","reason":"premise"},{"node":"leetcode-solutions-no-validation-convention","truth_value":"IN","reason":"premise"}]}}