Repository navigation
fix: draw each drift threshold step at its own slice's threshold - #14
Open
JingHao-Leon wants to merge 2 commits into
Open
JingHao-Leon wants to merge 2 commits into
JingHao-Leon wants to merge 2 commits into
Conversation
The horizontal step over a slice was drawn at the next slice's threshold, so the line read a threshold the slice underneath it never had and the segments did not join up. Signed-off-by: JingHao-Leon <102573344+JingHao-Leon@users.noreply.github.com>
The horizontal step over a slice was drawn at the next slice's threshold while the dashed connector at the same x joined the two, so the staircase never met: the line read a threshold the slice underneath it never had, and the first slice's own threshold was drawn nowhere. Signed-off-by: JingHao-Leon <102573344+JingHao-Leon@users.noreply.github.com>
JingHao-Leon
force-pushed
the
fix/drift-threshold-staircase
branch
from
October 19, 2026 21:38
b359145 to
217d3e6
Compare
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 broke
jeval.report.charts.drift.render_threshold_steps— the "Recommended threshold over time" staircase — drew each horizontal step at the next slice's threshold, so the line did not read the threshold of the slice it was drawn over and the segments never met.For slices with thresholds 0.50 / 0.60 / 0.70 the chart emitted:
(x0, 0.60)(x1, 0.60)(x1, 0.50)(x1, 0.60)(x1, 0.70)(x2, 0.70)(x2, 0.60)(x2, 0.70)The step over the first slice sat at 0.60 although that slice was measured at 0.50, and the connector at the first boundary ended at 0.60 while the step leaving it was at 0.70 — two horizontal lines with two connectors hanging below them, instead of one staircase.
Root cause
jeval/report/charts/drift.py:222-245. The connector atx(index + 1)was drawn fromleft_valuetoright_value— a step-after join, the value changes at the right edge of a slice — but the horizontal segment over the same span was drawn atright_value, the step-before height. The two halves of one step disagreed about which side of the boundary the value belonged to, so the horizontal segment was one slice ahead of the slice it covers.The change makes the horizontal segment sit at
left_value, the slice's own threshold, which is the convention the connector already used. The docstring now states that invariant.How it was verified
The regression test reads the emitted SVG back — the y-axis labels carry the scale, and two of them are enough to turn a pixel height back into a threshold — and asserts that the step over a slice is at that slice's own threshold and that each connector spans the two thresholds it joins.
Before the change, on the pristine source:
After the change:
Full suite, the gate CONTRIBUTING.md asks for:
CI status
DCO— ran and passed (gh pr checksreports one check,DCO,SUCCESS).CI— blocked and has not run. The workflow run for this head SHA isstatus=completed, conclusion=action_requiredwith 0 jobs: the repository's"Approve and run workflows" gate is holding it, so the lint-and-type-check job and the
pytest matrix on Python 3.10 / 3.11 / 3.12 have not executed. A maintainer has to approve
the workflow for them to run.
Because of that gate, the numbers above are all from a local run of the same gate
CONTRIBUTING.md asks for, not from CI.
Notes
jeval reportcurrently builds its drift view without cost-derived thresholds, so the chart is not emitted by that command today; the defect is in the chart builder itself.Fixes #13
This change was prepared with the assistance of an AI coding agent.