Objective
Manually test the pred CLI tool end-to-end. This covers all subcommands, error handling, piping, and JSON output modes.
Setup
# Build the CLI in release mode
make cli
# Verify installation
./target/release/pred --version
./target/release/pred --help
Or use cargo run with dev profile:
alias pred='cargo run --manifest-path problemreductions-cli/Cargo.toml --'
Testing Checklist
1. Discovery commands
2. Path finding
3. Problem creation
4. Evaluate
5. Reduce
6. Solve
7. Full closed-loop workflow
Test the complete pipeline end-to-end:
# Create → Solve → Verify
pred create MIS --graph 0-1,1-2,2-3,3-0 -o problem.json
pred solve problem.json -o result.json
# Check that the solution config is valid:
pred evaluate problem.json --config <solution_from_result>
# Create → Reduce → Solve → Verify
pred create MIS --graph 0-1,1-2,2-3 -o problem.json
pred path MIS QUBO -o path.json
pred reduce problem.json --via path.json -o reduced.json
pred solve reduced.json -o result.json
# Solution should be mapped back to MIS space
# Full pipe chain (requires --json on reduce)
pred create MIS --graph 0-1,1-2,2-3 | pred reduce - --to QUBO --json | pred solve -
8. JSON output and piping
9. Error handling
10. Shell completions
11. Known display issues
Reporting
For each failed item, please note:
- The exact command run
- The actual output / error
- The expected behavior
File findings as comments on this issue or as separate bug issues referencing this one.
Objective
Manually test the
predCLI tool end-to-end. This covers all subcommands, error handling, piping, and JSON output modes.Setup
Or use
cargo runwith dev profile:Testing Checklist
1. Discovery commands
pred list— lists all registered problems with aliasespred list --json— outputs valid JSON to stdoutpred show MIS— shows variants, size fields, and reductions for MISpred show MIS --json— JSON outputpred show MIS/UnitDiskGraph— shows a specific graph variantpred show MISpred from MIS— shows 1-hop outgoing neighborspred from MIS --hops 2— shows 2-hop outgoing neighborspred to QUBO— shows 1-hop incoming neighborspred to QUBO --hops 2— shows 2-hop incoming neighbors2. Path finding
pred path MIS QUBO— finds cheapest path (minimize steps)pred path MIS QUBO --all— lists all available pathspred path MIS QUBO --cost minimize:num_variables— custom cost functionpred path MIS QUBO -o path.json— saves path for use withpred reduce --viapred path MIS MIS— same source and target (edge case)pred path SAT QUBO— multi-step reduction path3. Problem creation
pred create MIS --graph 0-1,1-2,2-3 -o problem.jsonpred create MIS --graph 0-1,1-2 --weights 2,1,3pred create MVC --graph 0-1,1-2,2-0pred create MaxCut --graph 0-1,1-2,2-3pred create SAT --num-vars 3 --clauses "1,2;-1,3"pred create 3SAT --num-vars 4 --clauses "1,2,3;-1,-2,4"pred create QUBO --matrix "1,0.5;0.5,2"pred create KColoring --graph 0-1,1-2,2-0 --k 3pred create Factoring --target 15 --m 4 --n 4pred create MIS --random --num-vertices 10 --edge-prob 0.3pred create MIS --random --num-vertices 10 --seed 42— reproducible (run twice, compare)pred create MIS/KingsSubgraph/i32 --positions "0,0;1,0;1,1;0,1"pred create MIS/UnitDiskGraph/i32 --positions "0.0,0.0;1.0,0.0;0.5,0.8" --radius 1.54. Evaluate
pred evaluate problem.json --config 1,0,1,0— evaluates a configpred create MIS --graph 0-1,1-2 | pred evaluate - --config 1,0,1— piping from stdin5. Reduce
pred reduce problem.json --to QUBO -o reduced.json— direct reductionpred reduce problem.json --via path.json -o reduced.json— via saved pathpred create MIS --graph 0-1,1-2 | pred reduce - --to QUBO --json— piping (requires--json)pred inspect reduced.json— inspect the reduction bundle6. Solve
pred solve problem.json— ILP solver (default)pred solve problem.json --solver brute-force— brute-force solverpred solve reduced.json— solve a reduction bundle (solution mapped back)pred create MIS --graph 0-1,1-2 | pred solve -— pipingpred solve problem.json --timeout 10— timeout option7. Full closed-loop workflow
Test the complete pipeline end-to-end:
8. JSON output and piping
--jsonproduces valid JSON (pipe throughjq .to verify)-o file.jsonwrites valid JSON to the file-works for:evaluate,reduce,solve,inspect--quietsuppresses stderr info messages while still producing stdout outputreduce/solve/evaluatedon't auto-detect pipe —createoutputs JSON when stdout is not a TTY, but other commands always output human-readable text unless--jsonis specified9. Error handling
pred create MISwithout--graph) → helpful per-problem helppred evaluate→ clear errorpred from MIS/UnitDiskGraphfails because bothi32andOneweights match. Should prefer default weight.10. Shell completions
eval "$(pred completions)"fails on macOS zsh withcompdef:153: _comps: assignment to invalid subscript range11. Known display issues
from/todoesn't show variant —pred from MIS/UnitDiskGraph/i32shows "MaximumIndependentSet" instead of "MaximumIndependentSet/UnitDiskGraph"pred create SpinGlass/f64 --couplings 1.0,-0.5fails with "invalid digit found in string"--hopsdefault listed twice in help:[default: 1] [default: 1]Reporting
For each failed item, please note:
File findings as comments on this issue or as separate bug issues referencing this one.