Skip to content

dagql: read a term's equivalent results from the output class index - #15050

Open
yasyf wants to merge 1 commit into
dagger:mainfrom
yasyf:lookup-output-class-index
Open

yasyf wants to merge 1 commit into
dagger:mainfrom
yasyf:lookup-output-class-index

Conversation

@yasyf

@yasyf yasyf commented Nov 3, 2026

Copy link
Copy Markdown

Read a term's equivalent results from the output class index, so one lookup no longer walks every digest of a class under egraphMu. #15049 has the details.

When a term had no servable result of its own, appendTermSetResultsLocked walked every digest of the term's output class and every result posted under it. On a long-lived cache a class can hold over 100k digests, and a session could lose minutes this way while every other call waited.

outputEqClassResults holds the same results once each. cacheOutputEqClassCandidatesErrorLocked asserts that they match the digest postings, and appendOutputEqClassResultsLocked already says so in its comment. The function now takes sawExpired, so TestCacheEvidenceSawExpiredThroughEqClassExpansion keeps covering expiry on this path.

On engines restored from the same cache, a session of 650 checks took 381 s with this change and 720 s without. Later sessions and all-cached sessions did not change beyond noise.

When a term has no result of its own, lookup walked every digest of the
output class and every result posted under it, all under egraphMu. Classes
reach 100k digests on a long-lived engine, so a session could lose minutes
this way while every other call waited. outputEqClassResults already holds
the same results once each.

Signed-off-by: Yasyf Mohamedali <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant