Repository navigation
test: translation-support inventory — every public query member classified and probed against EF Core (#384) - #386
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 <[email protected]>
|
When #399 merges (PR #400), the |
|
Further to the note above: #402 (PR #403) rewrites the in-memory reasons in |
|
Correction to the PR description and my earlier notes: the calendar factories are tracked, by #191 ("Translate the calendar factories when they read a column"). So |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…an the calendar factories under #191 (#384) The reasons quoted docs/efcore.md#what-runs-where as it stood before #399 listed every public query member and #402 rewrote the in-memory reasons. Each now follows its row. The calendar factories over a column are planned with #191, not client. No classification of a server or client member changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Closes #384
It reuses the composition helpers from #383, which has merged, so it's now based on
maindirectly. #408 (10.3.0) depends on it, and #430 ports it torelease/10.x.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 reason quotes its row indocs/efcore.md#what-runs-where, 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-wheredidn't mention (classified from what the probe shows)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).#399 (PR #400) has since listed all of them, and their reasons now point at those rows. Only
RangeLowerBoundComparer.Compareis still unlisted, until #385 is fixed. The other reasons follow #402's rewrite (PR #403). The classifications didn't change.The calendar factories (
Month,Quarter,Year,IsoWeekwith a column argument) areplannedwith #191, which tracks them and which the docs link.Tests
After merging
mainand updating the reasons (2026-10-25, PostgreSQL 16 locally):TranslationSupportInventoryTestsand the oracle tests 65/65, conventions project 416/416,TranslationSupportProbeTestspasses with the #385 candidate. With*Range.Month(*classifiedserver, the probe fails with "classified server, but refused" on everyMonthoverload ofDateRangeandLocalDateRange, so it reaches the calendar entries.As first opened:
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