You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Web Fetch: one report model and a mode registry for report builds #328
The Web Fetch renderer has no input schema and several unrelated generators.
web_fetch/report.py (4,684 lines) defines generate (:2252, dicts plus nine keyword flags), generate_wcxb (:137), generate_cohort_diagnostic (:822), generate_public_benchmark_research (:1002), generate_webmainbench (:3714) and generate_webmainbench_full (:4069), sharing only small helpers.
Mode is inferred from dict keys (dataset['comparison'] read 29 times, saved_matrix_scope 13 times) and from ContextVars _REPORT_PROVIDER_LABELS and _REPORT_SUITES (report.py:407, 417) set by the saved-matrix adapter (report_saved_matrix.py:3059-3060); generate imports from the saved-matrix module (report.py:2253-2254).
scripts/build_report.py selects about ten modes through mutually exclusive flags with hand-written exclusion lists (:61, 69, 81, 94, 110, 118) and branches on variant and comparison_kind (:98, 105, 152).
Kind branches recur in report_build.py:209, 535, 753, 861, 925, 1615, report_check.py:491, 821, 948 and report_package.py:101.
Direction
Define a report model schema: participants, populations, result rows, evidence links, sections and state. Each build mode becomes an input adapter that produces the model, registered by variant; one renderer consumes it. Benchmark-specific views become section hooks. Remove the ContextVars and the reverse import, and reduce scripts/build_report.py to a thin entry.
Done when
One renderer entry that takes a validated report model.
Build, check and package select behaviour from the variant registry, not from kind comparisons.
Existing report variants build with unchanged measurements.
Paths are relative to src/harness/ unless prefixed; line numbers are from main at 997a228.
Done (#375, #377): typed report model, variant registry, one render_report entry, Web Fetch track template, WCXB/WebMainBench page sets as benchmark views() hooks, kind branches as declared kinds, variants recorded and checked. Accepted remainder: one render-scope ContextVar in report_model.py (passing it explicitly touches ~120 call sites for no behavioural gain).
Activity
lanyue-llk commentedon Nov 24, 2026
Done (#375, #377): typed report model, variant registry, one
render_reportentry, Web Fetch track template, WCXB/WebMainBench page sets as benchmarkviews()hooks, kind branches as declared kinds, variants recorded and checked. Accepted remainder: one render-scope ContextVar inreport_model.py(passing it explicitly touches ~120 call sites for no behavioural gain).