Skip to content

Lambda translator, second slice: the parity sweep against EF Core's query SQL, and the same rows answered on PostgreSQL 18 #74

Closed

Description

@CaffeinatedCoder

The second slice of #26.

Problem

The translator (#71) is held by rule tests: each says what a lambda is written as. Nothing checks that this is what EF Core's own queries write for the same lambda, which is the point: PostgreSQL uses an expression index only for a query whose expression matches it, and a predicate with other null semantics covers other rows.

Change

5.x's differential sweep, ported as files into test/CodoMetis.EFCore.SchemaKit.Tests/TranslatorParity:

  • The catalogue reads the translator's own tables and crosses every construct with every operand shape. Rows are C# source compiled by Roslyn, so the lambdas have the compiler's real shapes.
  • Both sides are rendered: the translator and the kernel's resolver on the one, EF Core's ToQueryString() on the other (Where for a predicate, Select for an expression). Both are parsed with PostgreSQL's precedence before they are compared.
  • A disagreement is fixed or listed in waivers.txt with its reason; a waiver that no longer matches a disagreement fails.
  • The same rows run on PostgreSQL 18: a pair that renders alike, or that a waiver calls equivalent, must select the same rows and compute the same values, and an expression a waiver calls equivalent must serve EF Core's query from an index on the translator's SQL.

The part that is written anew is how SchemaKit's side is rendered: 5.x went through its declaration and its differ.

Not in this slice

Members of a JSON document. The kernel's resolver refuses a path into one until a provider package renders it (#43), so the catalogue leaves that operand shape out behind one switch, to be turned on with it.

Done when

The sweep is green against EF Core's ToQueryString() and on PostgreSQL 18, every waiver has its reason, and undoing a rule of the translator fails the sweep.

Activity

  1. added this to the 11.0.0 milestone on Nov 12, 2026
  2. added
    tests
    package/core
    area/expression-indexes
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/expression-indexespackage/coretests

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions