Repository navigation
MQ-R1 1/2 (T067): @media bands for native in the compiler, the band runtime reference and Chrome resize traces - #140
Merged
Merged
Conversation
…runtime reference and the Chrome resize traces Native targets are checked and lowered in every @media band, and accept @media where their profile proves at-rule:@media and each media feature in the media context (R13, retiring the until-MQ-R refusal). The band table (typed atoms, truth vectors) and the band state program fold every band into the state program as the internal env#band variable (R4, R5); MediaRuntime is the TypeScript reference of the runtime (one size change, one band delta, one layout); rt-band.ts is the device band lookup with Chrome's 1/64 px comparisons and float media size (R2, R3). Transitions a size change would start are refused on native until MQ-Rt (R8). Six media-runtime fixtures with resize scripts run on the band runtime and in Chrome through setViewportSize at DPR 1, 2, 2.625 and 3 (resize-capture.ts), and their passing cases derive the media profile rows.
…he band move throws
…t before any enforce-mode compile of a media fixture (dpr-vectors saw ios blocked)
…tted CSS of the media-runtime fixtures, DPR, pixel, break and hit captures and vectors, profiles with the media rows, north-star check, lanes.json)
…oves to parity); rt-band in the translator subset; .gitattributes in step order; pins the new fixtures move (hit suite 2084, state scripts, glyph clearance additions, s4b/s5 at-rule example, android-profile and hit identity scope)
…tted CSS of the media-runtime fixtures, DPR, pixel, break and hit captures and vectors, profiles with the media rows, north-star check, lanes.json)
… banded transitions and animations refused on native (MQ-Rt), near-threshold slack combinations refused at run-time switching until MQ-R0 (with the off-grid sweep), android-views band programs on the resize lanes, the (assignment, band) cap as a diagnostic, '@' reserved in document ids, mqr-forms for the other comparison forms
…tted CSS of the media-runtime fixtures, DPR, pixel, break and hit captures and vectors, profiles with the media rows, north-star check, lanes.json)
…; anim-bands: ios refuses a banded transition until MQ-Rt; the resize test names the backend in its step label)
Contributor
Author
|
Landing stopped at step Fix the cause, then hand #140 back to the landing queue with the new clean head. |
…ers): the resize-capture step moves to scripts/regen-steps/mq-r1.ts (after capture, so before profile-rows), the media-runtime group to one sorted GROUPS line, .gitattributes sorted; hit suite 2092 beside master's animator suite
Commands: pnpm regen --skip lanes-host --skip tw-sweep (macos-26) and pnpm regen --only lanes-host (xcode-27), alternated to a fixed point, then pnpm regen --only tw-sweep (macos-26). Base: fed6f56 Run: https://github.com/compiled-run/dragoncss/actions/runs/37275478198
…e, as in Chrome 44 Chrome 145 alias_for entries whose property Dragon compiles (flex, box-sizing, logical margins, paddings, borders and sizes), registered per family in css/aliases/<family>.ts. Aliases Chrome parses with UseAliasParsing, and the -webkit-writing-mode surrogate, stay refused. Fixture group aliases (alias-flex, alias-logical, reject-alias-legacy-parsing).
…lowering takes the image naturals and its programs the images and moving transforms; the hit suite checks move to master's p1-floor.json
Commands: pnpm regen --skip lanes-host --skip tw-sweep (macos-26) and pnpm regen --only lanes-host (xcode-27), alternated to a fixed point, then pnpm regen --only tw-sweep (macos-26). Base: 4d4251d Run: https://github.com/compiled-run/dragoncss/actions/runs/37326048481
… (the hit suite grows by the media-runtime layout vectors)
Commands: pnpm regen --skip lanes-host --skip tw-sweep (macos-26) and pnpm regen --only lanes-host (xcode-27), alternated to a fixed point, then pnpm regen --only tw-sweep (macos-26). Base: bb32cfb Run: https://github.com/compiled-run/dragoncss/actions/runs/37326021043
…, used by nativePrograms and nativeBandPrograms alike, so an img under a transform only a band change moves gets the direct draw in every band
Contributor
Author
|
Landing stopped at step Fix the cause, then hand #140 back to the landing queue with the new clean head. |
… expected-quads and expected-resize, both sides' package.json scripts
BG2-a: gradient raster engine (paint-gradient.ts) on master, unstacked (supersedes #99's engine)
…laims and the native profile tests (PR CI skips them; chrome-ports failed #197 at landing)
…y-claims, api-floor, floor-merge, macroscope-ignore) on every PR
…ild already regenerated the tree); regen jobs beside the shards; 4 Chrome shards; durations from run 37399249352
…l), strict otherwise; a device failure is a judge-devices problem with a count per case and its first details, not a driver error (#91)
…s; MQ-PREF is MQ-R2 and waits for MQ-R1 runtime and PNT1
… Chrome-proven outline geometry; a1 web, a2 native, unstacked)
…grew 1 MiB: spawnSync git ENOBUFS failed the landing proof)
Commands: pnpm regen
Commands: pnpm regen
Commands: pnpm regen
Commands: pnpm regen
Commands: pnpm regen; pnpm run parity:devices; pnpm regen
thejackshelton
added a commit
that referenced
this pull request
Oct 6, 2026
… keeps expected-resize and expected-scroll (sorted); profile-rows.ts keeps MQ-R1's deriveMediaRows and MEDIA_CONTEXT beside OVFL's PROFILE_NOTES note writer
thejackshelton
added a commit
that referenced
this pull request
Oct 6, 2026
…and the rest) into inl1a-lowering. Conflicts keep both sides: LayoutStyle carries INL1a's verticalAlign and GRID's grid and gridItem (input.ts, validate.ts schema and anonymous initials, environment.ts zoom, harness.ts decoders, STYLE_FIELDS, corpus and test style literals); Display is block, flex, grid or inline; unsupported.ts holds INL1a's inline codes and grid-layout; context.ts has INL1a's text-in-inline and text-beside-inline beside GRID's text-in-grid-item and text-as-anonymous-grid-item, and an inline item base before the flex and grid ones; ios-layout lowerBox takes the Lowerer and the grid parent: an inline-level run in a flex or grid container is an anonymous item (auto-placed in a grid), and a grid item is blockified so never an inline box; the hand-frozen calc goldens and vectors README gain the grid fields beside the inline ones (each file equals INL1a's without the grid keys and master's without the inline keys). Composition: validate.ts refuses a grid style or placement on an inline box, and text-in-flex covers inline content in a grid container; corpus-dpr INLINE_STYLE and two MQ-R1 tests gain the fields of the other side. Tests: grid.test (layout) and inline-lowering.test (dragon) cover inline content in grid containers
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.
MQ-R1 PR 1 of 2 (T067, binding spec
docs/goals/milestone-2-proof/notes/T067-mq-r-spec.md§6.2, R2 to R5, R8, R13). Branched from master; lands alone. PR 2 (the Swift and Kotlin runtime glue, theresizedevice step, the environment record in the dump, the AndroidconfigChanges, the translated rt-band vectors and thedevice-envrotation lane) builds on this one once it is on master.What changed
project.tschecks and lowers every @media band for every target, since a native root switches bands at run time as a browser does. A native target accepts a condition only where its profile provesat-rule:@mediaand eachmedia-feature:<name>in themediacontext; otherwise the condition is refused on that target, naming the missing rows (DRAGON_UNSUPPORTED_AT_RULE [ios]/[android], with aprofilefield). This replaces the "until MQ-R" literal. The 17-band refusal now names MQ-R4, and environment features name MQ-R2 (the R9 set) or MQ-R3.lower/band-program.tswrites each width and height feature as a typed atom and each band as its truth vector (bandTableOf), and folds every (app assignment, band) pair into one state program with the internal@env#bandvariable (bandStateProgram; the 64-assignment cap counts bands).MediaRuntime(packages/parity/src/media-runtime.ts, since the core imports the layout engine for types only) is the TypeScript reference of the runtime: a size change computes the new band, applies its delta through@env#band, then lays out once at the new size; app setters cannot set@env#band. The compile records every band's cases and lowering (InternalRecord.bands), exposed throughnativeBands,nativeBandPrograms,nativeBandProgramandnativeBandOfViewport.packages/layout/src/rt-band.ts(exported asrtBand): the media size isfround(fround(px) * fround(1 / dpr))of the root's whole device px;>=,<=and=take 1/64 px of slack,<and>are exact, negative queries follow Chrome, and orientation and aspect-ratio read the truncated size. It is written for the translator, which PR 2 runs.DRAGON_UNSUPPORTED_VALUE [ios]/[android], at the transition). It is a support fact, so like the animation gate it applies in enforce mode, not in the derive-mode lane compiles. ANIM-b1 is on master, so the refusal itself appears (notransitiondeclaration is UNSUPPORTED_PROPERTY any more).media-runtime(ltr and rtl):mqr-width-switch,mqr-height,mqr-state-band(a free state across three bands),mqr-vw-relayout(no @media: relayout only),mqr-nested(nested and comma-list @media over 5 bands) andmqr-music-shape(the north star's two breakpoints at half scale), plusreject-mqr-17-bandsandreject-mqr-env-feature. Each has a resize script on the 8 css px grid within 400x400.resize-capture.tsruns every script in Chrome throughPage.setViewportSize(state steps morph the DOM in place) at DPR 1, 2, 2.625 and 3, and in the compiled web rendering at DPR 1; captures are committed underpackages/parity/expected-resize/(regen stepresize-capture). The host lanes run each script onMediaRuntime: after the start and every step the program must be the per-case program of (app assignment, the band the compile-time partition gives that size) at that size with one layout per step (the R5 oracle), its engine frames must equal Chrome's exactly in zoomed LU, its background colours Chrome's computed ones, and the compiled rendering the authored one (chrome-dual). A test checks every script reaches every band of its fixture.profile:rowsderivesat-rule:@media,media-feature:widthandmedia-feature:heightrows (contextmedia) for ios and android (layout, linux-dragon-layout) and web (computed-value, chrome-dual) from the resize cases that pass.bandBoundaryExclusive(rt-band),bandStale,resizeSkipsRelayoutandbandDeltaDropped. The device-only plants (mediaSizeFromWindow,rotationLosesState,activityRecreated) come with PR 2's device code.Review round 1 (precomputed review of 2dac097)
... inside @media is unsupported on <target> ... (package MQ-Rt)), as on web until ANIM-mq. Tests: the review's@media (min-width: 400px) { .a { animation: spin 1s infinite } }and a band-only transition are refused; a keyframe refusal reached only in a non-fold band blocks.closeThresholds: both evaluations at every breakpoint, threshold +-1/64 and between them;DRAGON_UNSUPPORTED_AT_RULE [ios]/[android]naming MQ-R0). The review's(width <= 400px)+(width > 400px)is refused. A test sweeps every root of 0 to 2048 whole device px wide or high at DPR 1, 1.75, 2, 2.625, 3 and 3.5 over every media and mqr fixture: each maps to a band, and away from a threshold to the partition's band; of the committed fixtures only media-range is refused (it keeps its fold-band device cases, which never look a band up). One rule each side: rt-band.ts is Chrome's (checked against the committed Chrome corpus); when MQ-R0 lands, whichever lands second removes the refusal and runs the sweep on MQ-R0's partition.DRAGON_STATE_SPACE_LIMIT [ios]/[android]at the first @media.mqr-formswith a resize script covering plain=(with its slack at 352), a strict<range, an emmax-widthand a<=height range, every width group in both height groups. The boolean form(width)stays proven only by the corpus test: its band at width 0 no resize can reach.Not in this PR, and why
mqr-epsilonandmqr-orientation(and orientation and aspect-ratio bands generally) need MQ-R0's evaluator and partition (in flight onmq-r0). This PR does not touchmedia/**. rt-band already implements Chrome's rules for all four features, andband-program.test.tschecks its atoms against the whole committed Chrome media corpus (every query Dragon evaluates, at every captured viewport) and its band lookup against every captured band sheet.reject-mqr-transitionis a compiler test (media-runtime.test.ts), not a parity reject fixture: R8 blocks ios and android only, and a parity reject must block every output.docs/ports.jsondoes not get a secondmedia_query_evaluator.ccentry beside the one MQ-R0 adds.Outside the spec's file map
packages/parity/src/cli/resize-capture.ts,packages/parity/src/cli/resize-report.ts: the CLIs ofresize-capture.ts.packages/parity/src/profile-rows.ts(deriveMediaRows),scripts/gen-profile-rows.ts: the media rows.scripts/regen.ts,.gitattributes: theresize-captureregen step and its merge entry.packages/layout/src/index.ts: thertBandexport.packages/dragon/src/analysis/input.ts: '@' reserved at the start of a document id.packages/parity/src/media-runtime.ts: the runtime reference (the spec put it beside the compiler; the core may not run the engine).package.json: two script lines (parity:resize-capture,parity:resize-report), not one.packages/parity/src/fixture-groups/media.ts: the two reject message prefixes (below).Changed tests and pins, with reasons
packages/dragon/test/media-wiring.test.ts: the MQ-a pins that native is resolved in the fold's band only now pin MQ-R1's rule that native is checked in every band, because a native root switches to every band at run time. So a refusal raised only in a band outside the fold blocks native too, a rule in no band (@media print) still blocks nothing, and the unwrapped @supports rules are checked for ios as well as web. The public-entry test now pins acceptance with the committed media rows, and a second test pins the profile-driven refusal with the rows stripped (message, span, profile field). The refusal messages are retargeted to the MQ-R2, MQ-R3 and MQ-R4 texts, and an MQ-R3 case is added.packages/parity/test/media-sweep.test.ts: media-overlap's native refusal through the public entry becomes native acceptance.packages/parity/src/fixture-groups/media.ts:reject-media-prefers-color-schemeandreject-media-resolutionmessage prefixes are retargeted to the MQ-R2 text. Each still expects the same code, span and blocked outputs.packages/parity/test/parity.test.ts:layoutRowsalso leaves out themediacontext, as it already leaves outanimation. Media rows are proven by resize cases, andmedia-runtime-resize.test.tsgives them the same checks (exactly what profile:rows derives; exactly the passing cases that use the key). The paint-classification loop reads layout rows, since a media row keys no property.packages/parity/test/p6a-promotion.test.ts: a row whose feature keys no property (a media row) has no paint aspect, instead of throwing on the lookup.packages/parity/test/state-cases.test.ts,state-lanes.test.ts: derived counts 126 to 130 scripts and 22 to 24 groups, becausemqr-state-bandadds two assignments in two directions.packages/dragon/test/s4b.test.ts,s5.test.ts: their "unsupported at-rule" example was a width @media, which native now accepts; it is@container(refused on every target), as s5's next test already uses since MQ-a.packages/parity/test/android-profile.test.ts: the proving cases checked as native layout cases are those of layout rows; media rows are proven by resize cases, whichmedia-runtime-resize.test.tschecks.packages/parity/test/hit-capture-identity.test.ts: files beyond the pointer-events base may also belong to MQ-R1'smqr-*fixtures (new fixtures, not changed captures); the identity of every base file is unchanged.packages/parity/test/device-vectors.test.ts,packages/translate/test/translate.test.ts: derived count of the hit suite 2028 to 2092 (one case per layout vector at every DPR; the 16 new layout cases, mqr-forms included, at 4 DPR sets).packages/parity/test/glyph-clearance-pins.json: two entries appended formqr-music-shape(ltr, rtl) withDRAGON_PIN_WRITE=1; no existing pin changes.packages/parity/test/media-runtime.test.ts(new) holds the runtime reference's tests:MediaRuntimemoved from the core topackages/parity/src/media-runtime.ts, since the core imports@dragon/layoutfor types only (ua.test.ts, dist.test.ts).packages/parity/test/anim-bands.test.ts: a transition declared inside @media was pinned as refused on web and not on ios, because native resolved one band. Native now switches bands, so ios refuses it too (MQ-Rt, the review round 1 fix); the web refusal is unchanged.packages/parity/test/values.test.tsis unchanged: the new group sits beforevalues, which stays last beforestates.