Title: mcpx(ci): e2e-shard-packer crashes with raw tracebacks on a wrong-shape timings seed — non-object tests field and non-finite weights are unguarded · Issue #6822 · developing-today/code · GitHub
Open Graph Title: mcpx(ci): e2e-shard-packer crashes with raw tracebacks on a wrong-shape timings seed — non-object tests field and non-finite weights are unguarded · Issue #6822 · developing-today/code
X Title: mcpx(ci): e2e-shard-packer crashes with raw tracebacks on a wrong-shape timings seed — non-object tests field and non-finite weights are unguarded · Issue #6822 · developing-today/code
Description: mcpx(ci): e2e-shard-packer crashes with raw tracebacks on a wrong-shape timings seed — non-object tests field and non-finite weights are unguarded Summary pkgs/mcpx/scripts/ci/e2e-shard-packer.py (the #1994 measured-time shard packer tha...
Open Graph Description: mcpx(ci): e2e-shard-packer crashes with raw tracebacks on a wrong-shape timings seed — non-object tests field and non-finite weights are unguarded Summary pkgs/mcpx/scripts/ci/e2e-shard-packer.py (...
X Description: mcpx(ci): e2e-shard-packer crashes with raw tracebacks on a wrong-shape timings seed — non-object tests field and non-finite weights are unguarded Summary pkgs/mcpx/scripts/ci/e2e-shard-packer.py (...
Opengraph URL: https://github.com/developing-today/code/issues/6822
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mcpx(ci): e2e-shard-packer crashes with raw tracebacks on a wrong-shape timings seed — non-object tests field and non-finite weights are unguarded","articleBody":"# mcpx(ci): e2e-shard-packer crashes with raw tracebacks on a wrong-shape timings seed — non-object `tests` field and non-finite weights are unguarded\n\n## Summary\n\n`pkgs/mcpx/scripts/ci/e2e-shard-packer.py` (the #1994 measured-time shard packer that produces the mcpx-test e2e matrix) carefully guards its *discovery* side — the coverage assertion fails with a named `coverage defect: ...` message rather than emitting a bad matrix — but its *timings seed* side (`load_weights`) trusts the shape of `e2e-timings.json`:\n\n1. If the seed's `tests` field is present but not an object (a list, a string — a hand edit, or a future seed generator emitting pairs), `load_weights` raises a raw `AttributeError` from `raw.items()`.\n2. A weight of `Infinity` (which Python's `json.load` accepts by default in a seed file) passes the `seconds > 0` check, poisons the total, and `pack` raises a raw `OverflowError: cannot convert float infinity to integer`. (`NaN` is filtered only by accident, because `NaN > 0` is false.)\n3. A `true` weight is accepted as 1.0s, because `bool` is an `int` subclass and the `isinstance(seconds, (int, float))` check does not exclude it — the same bool-as-number class the fleet's other validators (#6637's `drain_last` check) explicitly exclude.\n\nIn every case the mcpx-test init job dies with an interpreter traceback instead of either the script's equal-weights fallback or a named error saying the seed is malformed and which entry is wrong — so a malformed seed regeneration blocks the whole e2e workflow with a message that points at the packer's internals, not at the seed.\n\n## Evidence (verified this run, laptop, origin/main c110f92897605d377b6cbae9b8dfc95f98f429b9)\n\nProbe: real `e2e-shard-packer.py` extracted verbatim from origin/main, driven through its own `load_weights`/`pack` (`~/git/fleet/probe-shard-packer`):\n\n- Control `{\"tests\": {\"TestA\": 10, \"TestB\": 20, \"TestC\": 30}}` → weights as measured, `pack` → 1 shard, OK.\n- `{\"tests\": [[\"TestA\", 10]]}` → `AttributeError: 'list' object has no attribute 'items'` at `load_weights` (`raw = doc.get(\"tests\", doc)` then `raw.items()`).\n- `{\"tests\": \"TestA=10\"}` → same `AttributeError` ('str').\n- `{\"tests\": {\"TestA\": Infinity, \"TestB\": 20, \"TestC\": 30}}` → accepted as a measured weight (`inf`), then `pack` raises `OverflowError` at `math.ceil(total / target_seconds)`.\n- `{\"tests\": {\"TestA\": true, ...}}` → weight silently becomes 1.0s.\n- (For reference: a wholly non-object seed, e.g. a top-level list, already falls back to equal weights, because `raw` becomes `{}` — only the `tests`-field shape and the weight values are unguarded.)\n\n## Why it matters\n\nThe seed is a committed file that timing tooling regenerates; the failure mode for a bad regeneration should be the packer's own contract style — fall back to equal weights with the note printed, or fail with a named error identifying the seed problem — never a raw traceback that fails the init job and every e2e leg behind it. This is the same wrong-shape-inside-a-valid-container class fixed for repo-universe (#6716/#6814) and github-backup (#6637/#6821).\n\n## Acceptance criteria\n\n- [ ] `load_weights` treats a non-object `tests` field as a malformed seed: named error (or equal-weights fallback with the reason in the weight note), never an `AttributeError` traceback.\n- [ ] Weights must be finite positive numbers and not bools: `Infinity`, `-Infinity`, `NaN`, and `true`/`false` values are rejected per-entry (skipped with the entry named, or the seed refused by name), and cannot poison the median or the shard-count arithmetic.\n- [ ] Well-formed seeds behave byte-identically to today (same matrix output for the committed `e2e-timings.json` and for the no-seed fallback).\n- [ ] Tests for the packer cover: list `tests`, string `tests`, infinite weight, bool weight, and the well-formed control; the mcpx-test workflow's init step still emits its matrix for the committed seed.\n\n## Dedup\n\nSearches (all states) for \"shard-packer\" and \"e2e-timings\": #1994 (closed, built the packer), #1992/#1985/#1901 (open, other mcpx testing topics). None covers the seed-shape guards. Filed by new-issue-creator-code-b, 2026-11-06 run.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-07T06:02:21Z","url":"https://github.com/developing-today/code/issues/6822"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:78704300-2d3e-3c8f-83b8-7bad78c47bf8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E8AE:3CF71B:2C7382:3BD386:6B0616EA |
| html-safe-nonce | 00c7f67715cd84ec842dcd1a73c5dd46f794f0ce2607ad113628d7063be20a68 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOEFFOjNDRjcxQjoyQzczODI6M0JEMzg2OjZCMDYxNkVBIiwidmlzaXRvcl9pZCI6IjgwODc1NTY5NjY4NTY4NDQ1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | af187ab362fcab6471ae72a0b341ba8f667724a7d3c65150b51f326d36328910 |
| hovercard-subject-tag | issue:6255836092 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/6822/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a688f6752b344f26d87517d85d0afcb1294f4198be3ac1df3c0020d8b42792a4/developing-today/code/issues/6822 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a688f6752b344f26d87517d85d0afcb1294f4198be3ac1df3c0020d8b42792a4/developing-today/code/issues/6822 |
| og:image:alt | mcpx(ci): e2e-shard-packer crashes with raw tracebacks on a wrong-shape timings seed — non-object tests field and non-finite weights are unguarded Summary pkgs/mcpx/scripts/ci/e2e-shard-packer.py (... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 866f202ebf7ac5aff8f633417d9fd8a53818a977 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width