Repository navigation
fix: the infinite range answers IsUnboundedStart and IsUnboundedEnd as lower_inf and upper_inf do - #168
Merged
Conversation
…s lower_inf and upper_inf do
IsUnboundedStart() and IsUnboundedEnd() on a single range tested the variant,
so the infinite range (,) answered false to both. EF Core translates them to
lower_inf and upper_inf, which answer true for it, and the one-element RangeSet
holding (,) answered true as well, so a query and the same predicate in memory
disagreed on every row holding (,), for all eleven range types, without an
error. docs/ranges.md promised the PostgreSQL meaning ("the state checks match
isempty, lower_inf and upper_inf"); only the XML doc promised the variant test.
PostgreSQL is the authority, so the two methods now answer true for (,) too.
The translation stays lower_inf / upper_inf and QueryTranslationTests pins that
it does not narrow to exclude (,); the variant interfaces remain the exact
shape test. IsInfinity and IsFinite are unchanged and now follow from the three
primitives in memory as they do in SQL.
ExecutedQueryTests.RangeShapePredicates_MatchInMemory runs the five checks over
a row of each shape and pins the infinite row to true; RangeShapePredicateTests
asserts the new partition. With the fix reverted both fail, and the
RangeSetLiftParityTests and DifferentialFuzzParityTests candidates for #109,
removed here, come back as unregistered rows (22 and 354 lines).
Closes #109
Found-By: OT
Defect-Class: ALG
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
CaffeinatedCoder
force-pushed
the
fix/infinite-range-is-unbounded
branch
from
October 18, 2026 13:27
4f80f00 to
a20aa1d
Compare
This was referenced Oct 18, 2026
…te-range-is-unbounded # Conflicts: # test/oracles/candidates.json
Base automatically changed from
fix/rangeset-overlaps-previous-element
to
main
October 18, 2026 14:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #109
Stacked on #167 (
fix/rangeset-overlaps-previous-element): merge that first, then retarget this tomain.Problem
IsUnboundedStart()andIsUnboundedEnd()on a single range tested the variant, so the infinite range(,)answeredfalseto both. EF Core translates them tolower_infandupper_inf, which answertruefor it, and the one-elementRangeSetholding(,)answeredtrueas well. A query and the same predicate in memory therefore disagreed on every row holding(,), for all eleven range types, with no error.docs/ranges.mdanddocs/efcore.mdpromised the PostgreSQL meaning; only the XML doc promised the variant test.Change
PostgreSQL is the authority, so memory moves:
src/CodoMetis.ValueRanges/RangeExtensions.cs:IsUnboundedStart()isIUnboundedStartRange<T> or IInfinityRange<T>,IsUnboundedEnd()likewise; the XML docs say so, namelower_inf/upper_inf, and point at the variant interfaces for the exact shape test.IsInfinity()andIsFinite()are unchanged and now follow from the three primitives in memory as they do in SQL.lower_inf/upper_inf.QueryTranslationTests.Range_StateChecks_TranslateToRangeFunctionsnow also asserts it does not narrow to exclude(,), which was the other way to agree.test/oracles/candidates.json: the 24 rows for IsUnboundedStart/IsUnboundedEnd on the infinite range answer false in memory and true through EF Core (lower_inf) #109 (2DifferentialFuzzParityTests, 22RangeSetLiftParityTests) are removed.CHANGELOG.md,src/CodoMetis.ValueRanges/CHANGELOG.md,docs/migration.md: the Breaking row and theCheck IsUnboundedStart() and IsUnboundedEnd() on the infinite rangesection.Tests
RangeShapePredicateTests:Infinite_IsUnboundedAtBothEnds_AsLowerInfAndUpperInfAre, the twoHoldsFor…AndTheInfiniteRangetests,EveryShape_IsExactlyOneVariantandIsInfinityAndIsFinite_FollowFromTheUnboundedChecks. Four fail with the fix reverted.ExecutedQueryTests.RangeShapePredicates_MatchInMemory(integration): the five checks over a row of each shape, memory against the server row by row, the infinite row pinned totrue, and aWhere(IsUnboundedStart)returning the rows memory selects. With the fix reverted:IsUnboundedStart on (,)expectedFalseactualTrue.RangeSetLiftParityTestsreports 22 unregistered lines (<Type> (,) IsUnboundedStart: range → False, RangeSet → True) andDifferentialFuzzParityTests354, since their candidates are gone.🤖 Generated with Claude Code