Repository navigation
test: translation-support inventory — every public query member classified and probed against EF Core (#384) - #386
Open
CaffeinatedCoder wants to merge 1 commit into
Open
CaffeinatedCoder wants to merge 1 commit into
CaffeinatedCoder wants to merge 1 commit into
Conversation
…ified and probed against EF Core (#384) The public API's query members are discovered (QueryMembers: every public method and instance property whose receiver, a parameter or the result is a range, a multirange or a value set; one key per overload, generic families kept generic; converters, constants and span/out overloads out by rule) and each is classified in test/oracles/translation-support.json as server, client (with the reason) or planned (with the issue). - TranslationSupportInventoryTests (conventions): every key classified, no stale entry, every entry with what its support needs. - TranslationSupportProbeTests (integration): 811 keys over 2,254 member/type cells, each with a column operand, first where the server must evaluate it (filter, null test, ordering for a non-nullable value, HAVING for an aggregate), then in a final projection, against memory over the loaded rows. The first run found #385: EF Core rewrites any Compare(a, b) to the natural order, so RangeLowerBoundComparer.Compare runs as SQL in the range order. Seeded by merge-translation-dropped.patch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 24, 2026
Open
This branch has not been deployed
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 #384
Stacked on #383 (it reuses the composition helpers and touches the same registry files); review that one first.
Problem
postgres-surface.jsoninventories PostgreSQL's side. Nothing inventoried the C# side: which public members a query can call, and whether EF Core runs each one as SQL.docs/efcore.md#what-runs-wherelists both halves by hand, and a member in neither table (a new overload, a generic family, a member the docs never mention) had no stated support. A member whose translation disappeared or appeared was noticed only if a hand-written test called it. The composition sweeps countedClampas "untranslated" without saying whether that was intended.Change
QueryMembers(conventions project, linked into the integration project): discovered from the public API, not from the translators. Every public method and instance property of a public, non-nested type of the two libraries whose receiver, a parameter or the result is a range, a multirange or a value set. One key per overload, with generic families kept generic. Converters, static constants and overloads an expression tree cannot hold (ReadOnlySpan<char>,out) are left out by rule. That gives 813 keys.test/oracles/translation-support.json: 36 entries, first match wins:server,client(with the reason) orplanned(with the issue). Every classification comes from the docs, or says plainly that the docs don't mention the member.TranslationSupportInventoryTests(conventions, no database): every key is classified, no entry is stale, and every entry carries what its support needs. A new public member fails CI until it is classified.TranslationSupportProbeTests(integration): 2,254 member × type cells over 13 range and 34 value set types, about 12 s. Each call takes a column as an operand. It first runs where the server must evaluate it: a filter for a predicate, a null test for a value that can be NULL, an ordering for one that can't (EF Core folds(int?)x == nullaway untranslated), andHAVINGfor an aggregate. Then it runs in a final projection. Both are compared with memory over the rows as loaded.oracles.json, named in E30/E31heldBy, described indocs/oracles.mdandAGENTS.md.What it found
silent, low): EF Core rewrites anyCompare(a, b)to the natural comparison. SoRangeLowerBoundComparer<TRange, T>.Instance.Compare(r.Period, p)runs as SQL in the full range order.Where(… == 0)drops ranges that sharep's lower bound. It is registered as a candidate. The root cause is EF Core's: a comparer that reversesintorder gets the same treatment. Reporting that upstream is separate.Members
docs/efcore.md#what-runs-wheredoesn't mention (classified from what the probe shows; listed for a docs decision)Equals(T)andEquals(object)on ranges,RangeSetand value sets.RangeSet.Count, theRangeSetindexer,Valueson a value set,GetEnumerator,From,Parse,ToString,GetHashCode, the NodaTime interop conversions (ToDateInterval,ToInterval,ToInstantRange,ToLocalDateRange,ToYearMonthRange), andRangeLowerBoundComparer.Compare(RangeLowerBoundComparer.Compare runs as SQL in the range order: EF Core rewrites any Compare(a, b) to the natural comparison #385).The docs call the calendar factories (
Month,Quarter,Year,IsoWeekwith a column argument) "not translated yet" but no issue tracks them, so they're classifiedclient, notplanned.Tests
TranslationSupportInventoryTests3/3; conventions project 412/412.TranslationSupportProbeTestspasses on PostgreSQL 16 and 18 with the RangeLowerBoundComparer.Compare runs as SQL in the range order: EF Core rewrites any Compare(a, b) to the natural comparison #385 candidate; integration project 301/301 on both.merge-translation-dropped.patch(the range translator stops translatingMerge): CAUGHT byTranslationSupportProbeTestsas "classified server, but refused" on every range type.Convertto the interface parameter (C# passes the column without one),CultureInfoas a constant in a client projection, and sub-microsecond probe elements (the store's truncation isTemporalStoreParityTests' to judge).🤖 Generated with Claude Code