CLI: the usage omits the documented shader precompile flags #2216

Closed
opened 2026-11-26 05:23:28 +00:00 by github-bot · 0 comments
Owner

@⁠itsonewi on GitHub · 2026-11-25 10:01 UTC · original

xcl shaders implements, and the README documents, an offline precompile workflow, but xcl --help does not mention any of it.

What the usage says

crates/xcl/src/main.rs, HELP (lines 20-49), the xcl shaders entry (lines 32-43), lists:

xcl shaders <file | folder | package.rpf> [--top N] [--json] [--recomp] [--compile N]
    ...
    --recomp: ...
    --compile N: ...
    --export-hlsl DIR [--count N] [--min-kb N] [--record-hash HEX]: ...
    --measure-pso HEX [--repeat N]: ...
    --direct [--sample N] [--seed S] [--validate] [--compare]: ...
    --timeout, --max-bytes, --threads, --json, --hash H, --dump DIR.

What is implemented

crates/xcl/src/shaders.rs lines 894-901:

if args.iter().any(|a| a == "--precompile") {
    let only = args.iter().position(|a| a == "--only").and_then(|i| args.get(i + 1))...
    let pipelines = args.iter().any(|a| a == "--pipelines");
    // `--used-only`: ...
    let used = args.iter().any(|a| a == "--used-only")...
    ...
}

So --precompile, --only <stage>, --pipelines and --used-only are real, parsed options. The README uses them as the supported way to build pipelines ahead of a run:

xcl shaders D:\data\shaders.rpf --precompile --only cs --pipelines
xcl shaders D:\data\shaders.rpf --precompile --only cs --pipelines --used-only

(README.md lines 222-223)

Why it matters

The offline precompile path is the workaround for the cold-PSO stalls the project is tracking (#2088, #1035, #1598): build the compute pipelines once, save the driver blobs, and the next run does not compile them at play time. A user who runs xcl shaders --help to find that workflow sees --recomp, --compile and --direct, none of which is it. The only pointer is the README, and the in-binary help is the natural place to look.

#1468 (open) adds xcl <command> --help and a CLI test, but it prints this same HELP string, so the new xcl shaders --help will still omit the four flags.

Suggested fix

  • Add the four flags to the xcl shaders block in HELP, for example:
    --precompile [--only STAGE] [--pipelines] [--used-only]: builds the compute
        pipelines ahead of a run and saves the driver blobs for the next one;
        --used-only limits it to the pipelines an earlier run used.
    
    (exact wording up to the maintainers; the point is that the flags appear with the other shader options.)
  • If the other parsed-but-unlisted flags (--windows, --iface, --lanes, --limit, --split, --trace, --example) are internal, say so in a comment in shaders.rs or group them under a "developer options" line, so the gap is deliberate rather than accidental.
  • Extend the cli_help.rs test from #1468: assert that each documented flag string appears in the xcl shaders --help output. That keeps the help and the parser from drifting again.

The same audit found no other missing user-facing flags in disasm, rpf or inspect; those help blocks match their parsers.

Related

  • #1468 (open): makes --help print the usage; does not change its contents.
  • #1735 (open): CLI integration tests for top-level flags and inspect.
  • #601 (open): docs/architecture index; not a duplicate.

Scope

Read through the GitHub API at 568e7db; nothing was cloned, built or run.

**@⁠itsonewi** on GitHub · 2026-11-25 10:01 UTC · [original](https://github.com/xcl-dev/xcl/issues/2216) `xcl shaders` implements, and the README documents, an offline precompile workflow, but `xcl --help` does not mention any of it. **What the usage says** `crates/xcl/src/main.rs`, `HELP` (lines 20-49), the `xcl shaders` entry (lines 32-43), lists: ``` xcl shaders <file | folder | package.rpf> [--top N] [--json] [--recomp] [--compile N] ... --recomp: ... --compile N: ... --export-hlsl DIR [--count N] [--min-kb N] [--record-hash HEX]: ... --measure-pso HEX [--repeat N]: ... --direct [--sample N] [--seed S] [--validate] [--compare]: ... --timeout, --max-bytes, --threads, --json, --hash H, --dump DIR. ``` **What is implemented** `crates/xcl/src/shaders.rs` lines 894-901: ```rust if args.iter().any(|a| a == "--precompile") { let only = args.iter().position(|a| a == "--only").and_then(|i| args.get(i + 1))... let pipelines = args.iter().any(|a| a == "--pipelines"); // `--used-only`: ... let used = args.iter().any(|a| a == "--used-only")... ... } ``` So `--precompile`, `--only <stage>`, `--pipelines` and `--used-only` are real, parsed options. The README uses them as the supported way to build pipelines ahead of a run: ``` xcl shaders D:\data\shaders.rpf --precompile --only cs --pipelines xcl shaders D:\data\shaders.rpf --precompile --only cs --pipelines --used-only ``` (README.md lines 222-223) **Why it matters** The offline precompile path is the workaround for the cold-PSO stalls the project is tracking (#2088, #1035, #1598): build the compute pipelines once, save the driver blobs, and the next run does not compile them at play time. A user who runs `xcl shaders --help` to find that workflow sees `--recomp`, `--compile` and `--direct`, none of which is it. The only pointer is the README, and the in-binary help is the natural place to look. #1468 (open) adds `xcl <command> --help` and a CLI test, but it prints this same `HELP` string, so the new `xcl shaders --help` will still omit the four flags. **Suggested fix** - Add the four flags to the `xcl shaders` block in `HELP`, for example: ``` --precompile [--only STAGE] [--pipelines] [--used-only]: builds the compute pipelines ahead of a run and saves the driver blobs for the next one; --used-only limits it to the pipelines an earlier run used. ``` (exact wording up to the maintainers; the point is that the flags appear with the other shader options.) - If the other parsed-but-unlisted flags (`--windows`, `--iface`, `--lanes`, `--limit`, `--split`, `--trace`, `--example`) are internal, say so in a comment in `shaders.rs` or group them under a "developer options" line, so the gap is deliberate rather than accidental. - Extend the `cli_help.rs` test from #1468: assert that each documented flag string appears in the `xcl shaders --help` output. That keeps the help and the parser from drifting again. The same audit found no other missing user-facing flags in `disasm`, `rpf` or `inspect`; those help blocks match their parsers. **Related** - #1468 (open): makes `--help` print the usage; does not change its contents. - #1735 (open): CLI integration tests for top-level flags and `inspect`. - #601 (open): docs/architecture index; not a duplicate. **Scope** Read through the GitHub API at `568e7db`; nothing was cloned, built or run.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:23:28 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.