Repository navigation
fix(metadata): read behavior protocol from the response - #222
Merged
KartikP merged 4 commits intoNov 9, 2026
Merged
Conversation
The behavioral protocol stamp read the private _use_generation_for_task flag, so a subject that is not a BrainScoreModel but answers by generation was stamped behavior:readout (Contract Rule 2.2). record_measures() now collects attrs['measure'] of each behavioral response core hands to a benchmark (legacy facade, behavioral_response, BrainScoreModel.process). The protocol and a new optional attrs['measure'] score field come from that record. Likelihood answers are stamped behavior:likelihood, not readout. With no record the old default stamp is kept.
Note the measure of each behavior StreamEvent when it is created, so direct sessions, typed response tasks and mixed collections are all recorded before any session concatenates payloads. The facade and behavioral_response notes are now redundant and removed. A nested record passes its measures to the outer record. Measures made in a worker thread or process are not recorded; no behavioral path does that today.
The StreamEvent constructor hook also noted events no session accepted (decoded run records, fixtures, copies) and missed events made before the run and sent during it. note_response now runs in respond/emit of BufferedSession and the three perception sessions. A failed inner record passes nothing to the outer record.
KartikP
force-pushed
the
fix/score-protocol-from-response
branch
from
November 9, 2026 18:57
beafe4b to
34bf12c
Compare
This was referenced Nov 9, 2026
KartikP
added a commit
to brain-score/vision
that referenced
this pull request
Nov 10, 2026
`score()` read the behavior protocol from the subject's private state, so a subject that is not a BrainScoreModel but answers by generation was stamped behavior:readout (Contract Rule 2.2). Changes: - `score()` opens core's `record_measures()` around the benchmark run and passes the record to `infer_score_protocol` and `stamp_score_metadata`. The protocol and the optional `attrs['measure']` come from the responses the subject returned. - A core without `record_measures` raises an ImportError that names the required revision. - `requirements-v2.txt` pins core to fdeb451 (brain-score/core#222, which adds `record_measures`; it also contains #221). Evidence: new tests in tests/test_preflight.py send a real behavior StreamEvent into a BufferedSession and check the stamp. Core #222 passed its full CI, including the vision, language and unified offline suites.
KartikP
added a commit
to brain-score/language
that referenced
this pull request
Nov 10, 2026
`score()` read the behavior protocol from the subject's private state, so a subject that is not a BrainScoreModel but answers by generation was stamped behavior:readout (Contract Rule 2.2). Changes: - `score()` opens core's `record_measures()` around the benchmark run and passes the record to `infer_score_protocol` and `stamp_score_metadata`. The protocol and the optional `attrs['measure']` come from the responses the subject returned. - A core without `record_measures` raises an ImportError that names the required revision. - `requirements-v2.txt` pins core to fdeb451 (brain-score/core#222, which adds `record_measures`; it also contains #221). Evidence: new tests in tests/test_preflight.py send a real behavior StreamEvent into a BufferedSession and check the stamp. Core #222 passed its full CI, including the vision, language and unified offline suites.
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.
The behavioral protocol stamp read the private
_use_generation_for_taskflag. A subject that is not a BrainScoreModel but answers by generation was stamped behavior:readout (Contract Rule 2.2).Changes:
record_measures()context collectsattrs['measure']of each behavioral response at the point where a session accepts it (respond/emit of BufferedSession and the three perception sessions). Events no session accepted are not recorded. A nested record passes its measures to the outer record; a failed inner record passes nothing.infer_score_protocolandstamp_score_metadatatake the record. The protocol and a new optionalattrs['measure']score field come from it. Likelihood answers are stamped behavior:likelihood. With no record the old default stamp is kept.The
score()callers in vision, language and unified open the record in follow-up PRs, which pin this commit.Evidence: tests/test_score_metadata.py (+30 cases: direct sessions, typed response tasks, mixed collections, nested and failed records, unaccepted events).