Skip to content

test(ts): pick lang cases by two bytes, so none past 255 is silently skipped - #414

Closed
kixelated wants to merge 3 commits into
mainfrom
ts-harness/selector
Closed

kixelated wants to merge 3 commits into
mainfrom
ts-harness/selector

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Problem

The lang fixture's harness picks a case by the input's first byte, modulo the case count, and op(name) truncates a case's index to u8. Byte 0xff is reserved for Fault's printing. So the harness can address only 255 cases, and main has exactly 255. A PR that adds a case past index 254 compiles and passes, but the new case is never run differentially: op("new::case") wraps to an existing case, and both sides run that one and agree. #400 (259 cases, 260 after main) and its follow-up would have landed with none of their new cases run.

On main, no case was skipped: indices 0 through 254 are all reachable. Queued PRs that add lang cases (#387, #391, #394 may) get theirs exercised once this lands.

Approach

  • harness::run picks a case by the first two bytes, big-endian, modulo the count. The kind is the third byte and the case's input the rest. op(name) returns that u16, and panics, loudly on both sides, for a case two bytes can't pick (a first byte of 0xff stays Fault's).
  • caller.ts wraps op to give both bytes and spreads them into each named input. It exports ops, every case's bytes, built through op from the harness's own cases() list, so a case that can't be picked fails at load. within reads the two-byte selector and the kind from the third byte, and skips a Fault input.
  • differential.ts sweeps each op the harness exports as ops (default: each first byte alone, as before, for the other fixtures) with every short tail, and runs its full-width values through the first eight. It fails if two ops share bytes, which a repeated case name would cause. So every named case runs, each with its sweep.

Impact

  • Test harness only: no output, runtime, or public API change.
  • Other fixtures' harnesses keep the one-byte selector; a harness opts into another by exporting ops.

Tests: just ci passes, including the lang differential over the new selector (UPDATE_EXPECT changed only expected/harness.ts, for run and op).

Alternatives

  • An escape byte, such as 0xfe, picking a second table. Rejected: two selection rules, and the next overflow would need another.
  • A unit test in the lang fixture asserting each case's index fits. Rejected: just ts test tests only rust2-ts, so the fixture's own tests would not run; the guard is in op and the differential, which do run.

Follow-ups

None.

Review

  • Codex gpt-6.1-sol at medium effort (quest review), round 2 on 6741cad9: no findings.
  • Round 1 on fb013bd4: an input starting with 0xff, which prints a Fault, could decode as a float case in within and throw on its output. Fixed in be197682: within skips it.
  • just ci passes locally on 6741cad9, with main merged in.

(written by Claude Opus 5.5)

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 55 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f5ef1854-d828-4637-aaf5-4d7e143768c5
Commits

Reviewing files that changed from the base of the PR and between 6ff36bb and 6741cad.

Files selected for processing: 4
  • ts/fixtures/lang/caller.ts
  • ts/fixtures/lang/expected/harness.ts
  • ts/fixtures/lang/src/harness.rs
  • ts/tests/differential.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@kixelated

Copy link
Copy Markdown
Collaborator Author

Superseded: #417 was stacked on this branch, and its squash (b1656c9) landed this PR's two-byte selector and its Fault fix on main. Nothing is left to merge.

(written by Claude Opus 5.5)

@kixelated kixelated closed this Nov 2, 2026
auto-merge was automatically disabled November 2, 2026 05:28

Pull request was closed

@moq-bot

moq-bot Bot commented Nov 2, 2026

Copy link
Copy Markdown

codex / Codex land fixer: PR cl·osed or head moved while fixing; inspect and pick it again. Recommendation: run /quest-iterate before picking it again.

(HEAD detached at 6ec33a9) 6ec33a9058c2e8417e9a5aeb175b59d1824d7a36
base 6ec33a9058c2e8417e9a5aeb175b59d1824d7a36
batch ffaa75f9cee1e73b8fb32773c092bf60e88150fb
pr-407 cea21c2be0424d72bc92338cf785f763ead65ee9
pr-414 6741cad939352cec24c8038167f8852210f0e584
pr-416 67a1ac4c3567755320c4d4cf1bff3c784faa31ed

codex
All TypeScript tests passed, including `lang` and `stock`. I’ll record unchanged requeues for all three PRs and name the flaky `stock` failure. No mechanical source fix was needed, and the PR branches remain at their pinned heads.
apply patch
patch: completed
/work/quest-land-result.json
diff --git a/quest-land-result.json b/quest-land-result.json
new file mode 100644
index 0000000000000000000000000000000000000000..b5ae8af80eacadbc2b1fa713c9339aceb89eef04
--- /dev/null
+++ b/quest-land-result.json
@@ -0,0 +1,17 @@
+[
+  {
+    "number": 407,
+    "action": "requeue",
+    "reason": "Healthy against base; flaky ts fixtures::stock failed writing CACHEDIR.TAG in the shared build directory. Validation passed: quest check; just ffi test plus just ffi test --test fixtures -- api_kotlin api_swift with the installed coroutine jar and Swift library paths configured; just ts test on the shared TS code. PR head unchanged."
+  },
+  {
+    "number": 414,
+    "action": "requeue",
+    "reason": "Healthy against base; flaky ts fixtures::stock failed writing CACHEDIR.TAG in the shared build directory, whose setup this PR does not change. Validation passed: quest check; just ts test (7 unit, 12 fixture and 8 runtime tests, including stock). PR head unchanged."
+  },
+  {
+    "number": 416,
+    "action": "requeue",
+    "reason": "Healthy documentation-only PR against base; flaky ts fixtures::stock failed writing CACHEDIR.TAG in unchanged code. Validation passed: quest check; just ts test --test fixtures stock -- --exact. PR head unchanged."
+  }
+]

exec
/bin/bash -lc "python3 -c 'import json, pathlib, subprocess; p=pathlib.Path(\"quest-land-result.json\"); r=json.loads(p.read_text()); expected={407:\"cea21c2be0424d72bc92338cf785f763ead65ee9\",414:\"6741cad939352cec24c8038167f8852210f0e584\",416:\"67a1ac4c3567755320c4d4cf1bff3c784faa31ed\"}; assert len(r)==3 and {x[\"number\"] for x in r}==set(expected); assert all(set(x)=={\"number\",\"action\",\"reason\"} and x[\"action\"]==\"requeue\" for x in r); assert all(subprocess.check_output([\"git\",\"rev-parse\",f\"pr-{n}\"],text=True).strip()==sha for n,sha in expected.items()); print(\"Result schema and unchanged PR heads verified\")'; git status --short" in /work
 succeeded in 0ms:
Result schema and unchanged PR heads verified
?? quest-land-result.json

diff --git a/quest-land-result.json b/quest-land-result.json
new file mode 100644
index 0000000000000000000000000000000000000000..b5ae8af80eacadbc2b1fa713c9339aceb89eef04
--- /dev/null
+++ b/quest-land-result.json
@@ -0,0 +1,17 @@
+[
+  {
+    "number": 407,
+    "action": "requeue",
+    "reason": "Healthy against base; flaky ts fixtures::stock failed writing CACHEDIR.TAG in the shared build directory. Validation passed: quest check; just ffi test plus just ffi test --test fixtures -- api_kotlin api_swift with the installed coroutine jar and Swift library paths configured; just ts test on the shared TS code. PR head unchanged."
+  },
+  {
+    "number": 414,
+    "action": "requeue",
+    "reason": "Healthy against base; flaky ts fixtures::stock failed writing CACHEDIR.TAG in the shared build directory, whose setup this PR does not change. Validation passed: quest check; just ts test (7 unit, 12 fixture and 8 runtime tests, including stock). PR head unchanged."
+  },
+  {
+    "number": 416,
+    "action": "requeue",
+    "reason": "Healthy documentation-only PR against base; flaky ts fixtures::stock failed writing CACHEDIR.TAG in unchanged code. Validation passed: quest check; just ts test --test fixtures stock -- --exact. PR head unchanged."
+  }
+]

codex
Wrote [quest-land-result.json](/work/quest-land-result.json), uncommitted.

All three PRs are marked for requeue unchanged. The flaky `stock` test passed on rerun; validation completed successfully. No PR was blamed.
diff --git a/quest-land-result.json b/quest-land-result.json
new file mode 100644
index 0000000000000000000000000000000000000000..b5ae8af80eacadbc2b1fa713c9339aceb89eef04
--- /dev/null
+++ b/quest-land-result.json
@@ -0,0 +1,17 @@
+[
+  {
+    "number": 407,
+    "action": "requeue",
+    "reason": "Healthy against base; flaky ts fixtures::stock failed writing CACHEDIR.TAG in the shared build directory. Validation passed: quest check; just ffi test plus just ffi test --test fixtures -- api_kotlin api_swift with the installed coroutine jar and Swift library paths configured; just ts test on the shared TS code. PR head unchanged."
+  },
+  {
+    "number": 414,
+    "action": "requeue",
+    "reason": "Healthy against base; flaky ts fixtures::stock failed writing CACHEDIR.TAG in the shared build directory, whose setup this PR does not change. Validation passed: quest check; just ts test (7 unit, 12 fixture and 8 runtime tests, including stock). PR head unchanged."
+  },
+  {
+    "number": 416,
+    "action": "requeue",
+    "reason": "Healthy documentation-only PR against base; flaky ts fixtures::stock failed writing CACHEDIR.TAG in unchanged code. Validation passed: quest check; just ts test --test fixtures stock -- --exact. PR head unchanged."
+  }
+]

tokens used
141,481
Wrote [quest-land-result.json](/work/quest-land-result.json), uncommitted.

All three PRs are marked for requeue unchanged. The flaky `stock` test passed on rerun; validation completed successfully. No PR was blamed.
fixer result written

(written by codex / Codex)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant