Repository navigation
Conversation
register_scorer takes deterministic=True for a scorer that never calls or looks up a model, and usersim rescore reruns exactly the scorers registered that way, so a scorer shipped in its own package can opt in. language_compliance, refusal_basics and response_shape declare it. assert_scorer_conforms reports a deterministic scorer that looks up a model, and the extension fixture checks that its scorer is rescorable from an installed package. Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
BaseProbe.description is the paragraph the per-row preview and the capability report show with the rows of a probe. Both read it through probe_description(label), which gives an empty string for a label no installed probe holds, so neither keeps a table of descriptions and a probe shipped in its own package is described the same way. Each built-in probe carries its description, and assert_probe_conforms checks that it is a string. Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
format_behavioral_profile_for_prompt takes chat_realism, a ChatRealism member, and no probe label. SHARING_DETAILS lets the simulated user give IDs, reference numbers and dates; ASKING, the default, keeps the user to what the assistant asks for. tool_calling asks for SHARING_DETAILS, so the shared module names no probe, and the prompt each probe builds is unchanged. Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
BaseProbe.default_scorers names the registered scorers that belong to a probe. usersim eval --scorers auto runs language_compliance, refusal_basics and response_shape, which apply to every probe, plus the default_scorers of each probe whose rows the pass evaluates, found by the probe_family the rows are stored under. auto combines with scorer names, each name runs once, and a family no installed probe stores rows under is named in a warning. Without auto, eval runs exactly the scorers named. Each built-in probe with a scorer of its own declares it, so auto over a run holding every built-in probe runs every scorer the capability report reads. register_scorer refuses the name auto, and assert_probe_conforms reports a default scorer that no registered scorer holds. The extension fixture probe declares its scorer, and make check-extensions checks that auto finds it by the family its rows are stored under. Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
A row whose probe_family cell is empty names no probe, so the evaluator attributes it to none. The judges score it on the axes every probe shares, and its scorers see an empty probe_family. usersim eval --scorers auto adds no probe scorers for such a row and leaves it out of the warning about families no installed probe stores rows under. Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
BaseProbe.asset_problems returns each problem with the assets a probe ships, found without a model call. usersim smoke runs it for every registered probe on its probe assets line, which names each probe that checks and fails with the first problems found, and assert_probe_conforms reports what it finds and checks that it is a classmethod returning a list of strings. The checks smoke made for the built-in probes move onto those probes: a fact bank and a probing taxonomy for every shipped locale, the topics, subjects and prompts files of the general probes, the prompts file and toolset seed of tool_calling, the parity, pressure and agentic-action banks with the action taxonomy, the en_US finance bank with its dynamic-tier taxonomy, and the identity spec. The finance check reads both files from disk rather than from the per-locale caches. The extension fixture probe checks its bank, and make check-extensions confirms that smoke runs it from an installed package. Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
BaseProbe.preview_fields lists what the Probe Inputs panel of the per-row preview shows for the rows of a probe, top to bottom. Each PreviewField names a column of the row, or with from_metadata a key the probe writes to state.metadata, and the label it is shown with. The panel reads them through probe_preview_fields, which gives none for a probe that is not installed, so preview.py holds no table of probes. The nine built-in probes the panel covered declare the same fields with the same labels. A probe registered from another package gets the panel without a change to the preview, which make check-extensions confirms from an installed package. assert_probe_conforms reports preview_fields that are not a tuple of PreviewField, each with a text key and label. Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
This branch has not been deployed
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.
What changed and why
A scorer declares whether
usersim rescoremay rerun it, and a probe declares the description its rows are shown with, what the preview shows of each row, the scorers that belong to it and the check of the assets it ships, so a scorer or probe shipped in its own package gets all five without a shared module naming it. The rules a simulated user writes by are chosen by name, and a row with no probe family is scored as belonging to no probe.Builds on #111.
register_scorer(name, fn, deterministic=True)marks a scorer that never calls or looks up a model.usersim rescorereruns exactly the scorers registered that way and refuses any other, naming why and listing the allowed ones.language_compliance,refusal_basicsandresponse_shapedeclare it.assert_scorer_conformsreports a scorer registered as deterministic that looks up a model.docs/engine/AUTHORING_A_PROBE.md,architecture/evaluator.md,templates/probe/README.mdand thedocs/extensions.mdexample scorer describe it.BaseProbe.descriptionis the paragraph the per-row preview and the capability report show with a probe's rows.probe_description(label), which gives an empty string for a label no installed probe holds, so a stored row from a probe that is not installed renders without one.assert_probe_conformschecks that it is a string. The authoring guide,architecture/probes.md, the template checklist and thedocs/extensions.mdexample probe describe it.format_behavioral_profile_for_prompttakeschat_realism, aChatRealismmember, and no probe label.SHARING_DETAILSlets the simulated user give IDs, reference numbers and dates;ASKING, the default, keeps the user to what the assistant asks for.tool_callingasks forSHARING_DETAILS. The prompts each probe builds are unchanged.BaseProbe.default_scorersnames the registered scorers that belong to a probe.usersim eval --scorers autorunslanguage_compliance,refusal_basicsandresponse_shape, which apply to every probe, plus thedefault_scorersof each probe whose rows the pass evaluates, found by theprobe_familythe rows are stored under.autocombines with scorer names and each name runs once. A family no installed probe stores its rows under is named in a warning.autoover a run holding every built-in probe runs every scorer the capability report reads.auto,usersim evalruns exactly the scorers named.register_scorerrefuses the nameauto, andassert_probe_conformsreports a default scorer that no registered scorer holds.architecture/evaluator.md,architecture/probes.md,docs/engine/README.md, the template checklist and thedocs/extensions.mdexample probe describe it.probe_familycell is empty names no probe, so the evaluator attributes it to none.probe_family.--scorers autoadds no probe's scorers for it, and leaves it out of the warning about families no installed probe stores rows under.architecture/evaluator.mdandarchitecture/plugins.mdsay what a scorer receives for such a row.BaseProbe.asset_problems()returns each problem with the assets a probe ships, found without a model call. The default checks nothing.usersim smokeruns it for every registered probe. Itsprobe assetsline names each probe that checks and fails with the first problems found; an exception a check raises is reported the same way.tool_calling's prompts file and toolset seed, the parity, pressure and agentic-action banks with the action taxonomy, theen_USfinance bank with its dynamic-tier taxonomy, and the identity spec.cli/smoke.pynames no probe's assets.assert_probe_conformsreports what the check finds, and a check that is not a classmethod, raises, or returns something other than a list of strings.architecture/assets.md,architecture/probes.md,docs/engine/README.md,CONTRIBUTING.md, the template checklist and thedocs/extensions.mdexample probe describe it.BaseProbe.preview_fieldslists what the per-row preview's Probe Inputs panel shows of each of the probe's rows, top to bottom, such as the bank entry the row drew.PreviewFieldnames a column of the row, or withfrom_metadata=Truea key the probe writes tostate.metadata, and the label it is shown with. The panel leaves out an empty field, and is left out when every field is.probe_preview_fields(label), which gives none for a probe that is not installed, sopreview.pyholds no table of probes.assert_probe_conformsreportspreview_fieldsthat are not a tuple ofPreviewField, each with a text key and label.architecture/probes.md, the template checklist and thedocs/extensions.mdexample probe describe it.The
make check-extensionsfixture registers its scorer as deterministic, names it in its probe'sdefault_scorers, checks its probe's bank inasset_problems, and lists a column inpreview_fields. From an installed package, the check confirms thatusersim rescoreaccepts the scorer, that--scorers autofinds it by the probe's family, which differs from its label, thatusersim smokeruns the fixture probe's asset check and the spec check its identity probe inherits, and that the preview's Probe Inputs panel shows the fixture probe's field.How it was verified
Each commit passes
make check-all && make test && make smokeon its own: 4565 tests after the first, 4567 after the second, 4570 after the third, 4587 after the fourth, 4593 after the fifth, 4612 after the sixth.New tests:
usersim rescorerefuses a scorer registered without the flag.assert_scorer_conformsreports a deterministic scorer that looks up a model, and not a scorer without the flag that does.assert_probe_conformsreports a description that is not a string.tool_callingsimulates may share structured details and thegeneral_open_endeduser may not, checked on the system prompt each user model receives.usersim eval --scorers tool_use,autoreaches the evaluator astool_use, the three rule-based scorers and the default scorers of the run's probes, each once.autoover every built-in probe leaves no capability without its scorer, andautoover each probe runs the scorers its capabilities read.register_scorerrefusesauto.assert_probe_conformsreports default scorers that are not a tuple of names, or that name no registered scorer.probe_familyis None, NaN,pd.NAor blank reaches its scorers with an empty family, and is judged on the shared axes alone.--scorers autogives a blank family the three rule-based scorers and no warning.probe assetsline names a probe that checks and leaves out one that does not, fails on a problem a check returns or an exception it raises, and names the first three problems with a count of the rest.assert_probe_conformsreports an asset check that is not a classmethod, returns a bare string, raises, or finds a problem.assert_probe_conformsreports preview fields given as one field, as plain tuples, or without a text label.The example package in
docs/extensions.mdmatches the guide's code blocks byte for byte, and its four tests pass with the deterministic scorer and the description.make health-checkagainst a custom provider config, withHEALTH_PROBE=tool_calling, with the defaultsov_ai_dynamicrow inja_JPafter the fifth commit, and withHEALTH_PROBE=financial_servicesafter the sixth: each time a two-turn row completed, the evaluator reportedfailed=0, and the report rendered.The three rule-based scorers, run by hand with
--scorers language_compliance,refusal_basics,response_shapeon an eight-turntool_callingrow against the same config:usersim rescorethen reran all three on that evaluation with no model call, and refusedtool_use:usersim eval --scorers autoon a new eight-turntool_callingrow against the same config resolved to the three rule-based scorers plustool_use, the probe's default scorer. The evaluator reportedfailed=0, and each scorer returned a result:After the sixth commit,
usersim eval --scorers autoon an eight-turnfinancial_servicesrow against the same config resolved to the three rule-based scorers plusfinancial_services. The evaluator reportedfailed=0, and each scorer returned a result:Results impact
None. Without
auto,usersim evalruns the scorers it is given, so evaluation cells and their envelopes are unchanged. The same three scorers are rescorable, every probe shows the same description, and every probe's user prompt is unchanged.usersim smokeruns the same asset checks for the built-in probes, on a line namedprobe assetsthat lists the probes it checked. Runs and their outputs are unchanged.The per-row preview shows the same Probe Inputs fields, with the same labels, for every built-in probe.
A row with no
probe_familyis judged on the shared axes, which are all the judges score for ageneral_open_endedrow, so its evaluation and envelope are unchanged. A scorer that readsprobe_familysees an empty string on such a row; no shipped scorer reads that field.