Index of every page on this site: llms.txt
All skills
astral-sh avatar

/wobbling-ty-constraint-order

@b6d9651
by Astralastral-sh/ruff51k stars
2,775
Run it yourself

Use when a user asks to wobble ty constraint ordering, check constraint-set or TDD ordering determinism, test reversed constraint/typevar IDs, or investigate nondeterministic ty inference and mdtest results.

Use this Skill: https://skilld.dev/gh/astral-sh/ruff/wobbling-ty-constraint-order

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈59 tokens for metadata: the name and description. ≈733 when used: this file.

Description uses 3.0% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈238 characters, or 3.0%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Wobbling ty constraint order

TY_CONSTRAINT_SET_ORDER perturbs both the builder-local TDD-variable order and the local typevar order used to orient typevar-to-typevar constraints. The setting is fixed for the lifetime of each test process.

  • unset/0: normal ordering;
  • reverse: reverse both orderings;
  • an integer: XOR each local ID with that mask. Small masks immediately perturb dense arena IDs: 1 swaps adjacent IDs, 3 reverses blocks of four, and powers of two exchange neighboring blocks.

This deliberately changes internal TDD shape. Run mdtests only: graph-structure unit snapshots are expected to differ. Never enable snapshot updates for a wobble run, since updating would hide the failures being sought.

Run

From the Ruff root, first establish the normal baseline, then run the reversed and XOR-masked orders sequentially. Set TY_CONSTRAINT_ORDER_LOG_DIR to retain logs in a particular writable directory; otherwise mktemp chooses an appropriate temporary directory (respecting the environment's temporary-directory configuration).

set -u

if test -n "${TY_CONSTRAINT_ORDER_LOG_DIR:-}"; then
    log_dir="$TY_CONSTRAINT_ORDER_LOG_DIR"
    mkdir -p "$log_dir"
else
    log_dir="$(mktemp -d -t ty-constraint-order.XXXXXXXX)"
fi
printf '%s\n' "logs: $log_dir"

if cargo nextest --version >/dev/null 2>&1; then
    runner=nextest
else
    runner=test
fi
printf '%s\n' "runner: cargo $runner"

export CARGO_PROFILE_DEV_OPT_LEVEL=1
export CARGO_PROFILE_DEV_DEBUG=line-tables-only
export INSTA_UPDATE=no
export MDTEST_UPDATE_SNAPSHOTS=0
unset INSTA_FORCE_PASS || true

for order in normal reverse 1 2 3 4 7 8 15; do
    if test "$order" = normal; then
        unset TY_CONSTRAINT_SET_ORDER || true
    else
        export TY_CONSTRAINT_SET_ORDER="$order"
    fi

    log="$log_dir/ty-constraint-order-${order}.log"
    if test "$runner" = nextest; then
        cargo nextest run -p ty_python_semantic --test mdtest \
            --no-fail-fast --status-level fail --failure-output immediate-final \
            >"$log" 2>&1
    else
        cargo test -p ty_python_semantic --test mdtest >"$log" 2>&1
    fi
    status=$?

    printf '%-7s exit=%s\n' "$order" "$status"
    grep -E 'Summary \[|test result:' "$log" | tail -1 || true
    printf '%s\n' "  log: $log"
done

Read each failing log and report the mdtest file, section, line, expected result, and actual diagnostic/revealed type. A wobble failure is evidence that inference semantics or displayed solution types still depend on ordering; do not update the mdtest expectations merely to make the wobble run green.

The knob does not perturb hashing of Salsa-backed values. The Solution binding order follows constraint source order section of regression/constraint_set_ordering.md separately varies typevar declaration order to catch binding-order changes caused by draining an FxHashMap<BoundTypeVarInstance, ...>.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts3mo3 checks · Risk SAFE
  • Gen Agent Trust Hub3mo

    The skill is a developer tool designed to test the determinism of type constraint ordering in Rust projects. It uses standard shell commands and the Cargo build system to run tests under different environment configurations.

  • Socket3mo

    No alerts

  • Snyk3mo

    Risk: LOW · No issues

Signed by skilld at b6d9651. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 4 months ago
Other metadata
compatibility
Requires Cargo, mktemp, and a POSIX-compatible shell; uses cargo-nextest when available and otherwise falls back to cargo test.

README badge

README badge for astral-sh/ruff/wobbling-ty-constraint-order