Repository navigation
fix(viewer): do not start the AI comparison at page load - #741
Open
omkargaikwad23 wants to merge 2 commits into
Open
omkargaikwad23 wants to merge 2 commits into
omkargaikwad23 wants to merge 2 commits into
Conversation
A link with ?tab=compare&eval1=...&eval2=... started the AI comparison in on_load. Each open of the link made a model call and held a server worker until the answer came. on_load now only opens the Compare tab and selects the two runs. A new button on the tab starts the comparison. compare_evals stores each result in memory. The key has the run IDs and the state of the run files, so a changed run gets a new comparison. It also refuses a run file that is larger than 100 MB.
omkargaikwad23
marked this pull request as ready for review
November 26, 2026 08:24
omkargaikwad23
requested review from
IsmailMehdi,
helloeve and
prernakakkar-google
as code owners
November 26, 2026 08:24
compare_evals called os.path.exists and os.path.getsize for the size check, and os.stat for the cache key. A file that disappeared between the calls raised an error. The size check now uses the same file state as the cache key.
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.
Problem
?tab=compare&eval1=...&eval2=...started the AI comparison during the page load. Each open of the link made a model call and held a server worker until the answer came.evals.csvandscores.csvfiles, with no size limit.Change
compare_evalsstores each result in memory (64 entries for each server process). The key has the two run IDs and the modification time and size of the run files, so a changed run gets a new comparison. An error is not stored.compare_evalsdoes not read a run file that is larger than 100 MB. It returns an error message.Behavior change
evals.csvorscores.csvabove 100 MB gets an error message in place of the AI comparison.Tests
viewer_ai_comparer_test.pyfor the stored result and the size limit..ci/verify_viewer.pyhas a new check:on_loadwith a compare link must not callcompare_evals, and the page must show the button..ci/verify_viewer.pyon_loadwith a compare link