test(tui): nothing drawn depends on colour; docs: launch_bounds is not validated - #64
Merged
Conversation
…proves it #58 was filed expecting a colour-only cue to vanish under NO_COLOR. Two things measured before writing any of it turned out otherwise. **The geometry half of the issue was already done.** It claimed the suite runs at one geometry, `size(110, 32)`. On main it runs nine tests at 80x24, two at 60x30, and reaches 110x32 by live resize, plus `a_refusal_reason_survives_a_narrow_terminal_whole`. #49 changed that after I measured. Corrected on the issue; nothing to do here. **The TUI emits no colour at all.** Every style in `app.rs` is `Modifier::BOLD` or `BOLD | REVERSED`; `Color::` appears nowhere in the crate, and the `styles:` block of the shipped golden names only `bold` and `reverse`. Bold and reverse are SGR attributes, not colour, and NO_COLOR does not ask anyone to drop them. So there was no cue to lose. That makes the honest test the stronger claim rather than the one asked for: - `no_view_of_the_tui_uses_colour` walks every cell of all four views at 80x24 and asserts `fg` and `bg` are the terminal default -- structurally, through `Cell::style()`, not by matching rendered strings. This is the guard that matters: the day someone marks a refusal red, it fires and names the cells, and they have to add a cue that survives without it. Verified by colouring the field heading: "overview: 24 cell(s) carry colour", listing the first eight. - `the_metal_banner_keeps_its_emphasis_under_no_color` re-runs the existing banner assertion under `NO_COLOR=1`, cell by cell across the whole banner. It is the cue the issue named and the one most likely to be reached for with colour later. - `no_color_changes_not_one_cell` compares styled frames with and without the variable and requires them byte-identical. If that ever fails, either colour was added or the app grew a NO_COLOR branch that changes layout -- and a layout depending on an environment variable needs its own golden. `spawn_in_with_env` keeps `env_clear`, so the child sees only what a test names. Sync policy unchanged: one predicate per instant, on view-body content rather than the footer, which names every view on every view. Closes #58 Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
The README says what launchbound does and LIMITATIONS is honest about the gate's inheritance, but one question went unanswered anywhere: does this validate `#[launch_bounds]` against register limits? It does not. It never reads a register count at all, and it does not check `#[launch_contract]` against grid limits either. The confusion is earned rather than hypothetical. The corpus *narrates* register pressure without checking it -- `stencil-1d/kernel.toml` opens with "the tuning story is UNROLL x RADIUS x launch_bounds against the register file" -- `lb_max` is a real tuning dimension in two kernels, `.maxntid` is emitted by cuda-oxide, and the tool is called *launchbound*. A reader arriving from cuda-oxide's docs, where `#[launch_bounds]` is a register-budgeting tool, will assume otherwise. Sharper than the issue put it: the one `.maxntid` relationship the corpus enforces, `exprs = ["block_x <= lb_max"]` in `stencil-1d`, holds because the kernel author wrote it as a constraint and the evaluator does what it is told. launchbound attaches no meaning to `lb_max`. Omit that expression and nothing catches a block larger than its own `.maxntid`. A "Not in scope" paragraph in README §"What it is, and is not", a matching LIMITATIONS section, and each links to the other -- both anchors checked against GitHub's slug rules rather than eyeballed, since a broken link in the sentence that says "we do not do this" is worse than no sentence. What would close the gap is named, so the next reader does not have to work it out: the PTX from `cargo oxide inspect` already carries `.maxntid` and register counts. A rule reading them is a new rule with its own measured result and its own calibration entry -- not a documentation change. Closes #59 Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
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.
Milestone 2.2.0, issues #58 and #59.
#58 — measured first, and the issue was wrong twice
The geometry half was already done. The issue claims the suite "runs at one geometry,
size(110, 32)". Onmainit runs nine tests at 80×24, two at 60×30, reaches 110×32 by live resize, and hasa_refusal_reason_survives_a_narrow_terminal_whole. #49 changed that after I measured. Corrected on the issue; nothing to do here.The TUI emits no colour at all. Every style in
app.rsisModifier::BOLDorBOLD | REVERSED;Color::appears nowhere in the crate; thestyles:block of the shipped golden names onlyboldandreverse. Bold and reverse are SGR attributes, not colour, andNO_COLORdoes not ask anyone to drop them. There was no colour-only cue to lose.So the tests assert the stronger and truer claim:
no_view_of_the_tui_uses_colourfg/bgare the terminal default — structurally, viaCell::style(), not by matching rendered stringsthe_metal_banner_keeps_its_emphasis_under_no_colorNO_COLOR=1, cell by cell across the whole banner — the cue the issue namedno_color_changes_not_one_cellThe first is the one that earns its keep: the day someone marks a refusal red, it fires and names the cells. Verified by colouring the field heading on purpose —
spawn_in_with_envkeepsenv_clear, so the child sees only what a test names. Sync policy unchanged: one predicate per instant, on view-body content rather than the footer (which names every view on every view).#59 — the question nothing answered
Does launchbound validate
#[launch_bounds]against register limits? No. It never reads a register count, and it does not check#[launch_contract]against grid limits either.The confusion is earned rather than hypothetical:
stencil-1d/kernel.tomlopens with "the tuning story is UNROLL × RADIUS × launch_bounds against the register file",lb_maxis a real tuning dimension in two kernels,.maxntidis emitted by cuda-oxide, and the tool is called launchbound.Sharper than the issue put it: the one
.maxntidrelationship the corpus enforces —exprs = ["block_x <= lb_max"]instencil-1d— holds because the kernel author wrote it as a constraint and the evaluator does what it is told. launchbound attaches no meaning tolb_max; omit the expression and nothing catches a block larger than its own.maxntid.A "Not in scope" paragraph in README §What it is, and is not, a matching LIMITATIONS section, each linking to the other — both anchors checked against GitHub's slug rules rather than eyeballed, since a broken link in the sentence that says "we do not do this" is worse than no sentence.
What would close the gap is named so the next reader need not work it out:
cargo oxide inspect's PTX already carries.maxntidand register counts. A rule reading them is a new rule with its own measured result and calibration entry — not a documentation change.just cigreen.Closes #58
Closes #59
Signed-off-by: Vyncint Ng 115854244+vyncint@users.noreply.github.com