Skip to content

Add a README figure of the recorded limit run - #35

Merged
IonDen merged 3 commits into
mainfrom
docs/limit-figure
Sep 17, 2026
Merged

IonDen merged 3 commits into
mainfrom
docs/limit-figure

Conversation

@IonDen

@IonDen IonDen commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

The README described an intervention in a transcript and a paragraph. This adds a picture of the same run: the footprint macOS charged to the job's process group over forty seconds, the warning band, the 6 GiB limit, the emergency line at 6.6 GiB, and the sample at which the supervisor sent SIGTERM. It follows the figure in mlx-train-perf's README in size, fonts and palette, so the two projects look related.

The curve, the thresholds, the times, the sample count and spacing, and the caption are read from the committed tutorial bundle: scripts/render_limit_figure.py takes the report's samples, thresholds, signal and outcome, the transcript's last printed MLX figure, and the provenance file, and writes docs/images/limit-intervention.svg. The wording of the annotations and where they sit are fixed for this recording. The job's last printed figure, 5.07 GiB, appears as a tick in the right margin and not as a point on the curve, because the report does not record when the job printed it.

python/tests/test_limit_figure.py fails when the committed SVG and the generator's output differ. The SVG carries a short digest of every fact it uses, because coordinates rounded to a tenth of a pixel would hide a small change in the evidence. The change-scope script now treats the figure and the tutorial bundle as code, so a pull request that touches only one of them still runs that test. The test also checks that the lines sit at the scaled report values, that a different limit moves the line and rewrites its label, that the curve keeps one point per sample, and that the file is accessible (role="img", an aria-label) and loads nothing from elsewhere, since GitHub and PyPI show it through an <img>.

The README embeds it by absolute URL at the top of the example section, which is how it also reaches the PyPI page at the next release. Until this is merged that URL does not resolve, so look at the SVG file in the diff rather than the README preview. I checked the rendering on a white and on a dark page.

Draw the tutorial's 6 GiB intervention from its committed report: every
footprint sample, the warning band, the limit, the emergency line and the
sample at which TERM was sent. scripts/render_limit_figure.py generates the
SVG from the evidence bundle, and a test fails when the committed figure and
the generator's output differ.
@IonDen IonDen self-assigned this Sep 17, 2026
@IonDen IonDen added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 17, 2026
…ning

The emergency threshold acts at or above its value, so say so. Read the sample
spacing and the consecutive-breach count from the report instead of typing
them, name the margin tick as MLX's active-memory figure, and put a digest of
the facts the figure uses into the SVG: coordinates rounded to a tenth of a
pixel hid a small change in the evidence from the drift test.

Classify the figure and the tutorial bundle as code in the change-scope
script. A pull request touching only one of them skipped the Python job, which
is where the drift test runs.
…IGTERM by name

"gone within 0.05 s" understated a measured 52 ms that is already an upper
bound of one poll. The README sentence next to the figure said "about every
50 ms" where the figure computes 58 ms between samples; call it the 50 ms
timer it is. A report with no SIGTERM, or no usable sample at the signal time,
now fails with a message naming what is missing instead of a bare
StopIteration.
@IonDen
IonDen merged commit 8056a88 into main Sep 17, 2026
5 checks passed
@IonDen
IonDen deleted the docs/limit-figure branch September 17, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant