Repository navigation
PolyBench datasets, exact union model for imperfect nests, fuse/shift, measurement + SSRF hardening (0.3.0) - #33
Conversation
…, measurement and SSRF hardening Sizes (6): MINI..EXTRALARGE are now PolyBench/C 4.2.1's own per-kernel dataset tables (from its headers); DEFAULT, the new default everywhere, keeps each kernel's built-in size. 3mm/atax/bicg/fdtd-2d use PolyBench's rectangular shapes. bench.py/baselines.py default to LARGE (where tiling pays: gemm tile3d 12.8x vs 9.8x untiled) with --size/--rounds/--kernels. Imperfect nests (7): legality is exact over all statements via the new compilot/union.py (domains from loops, accesses read from the C bodies, the loop tree as a 2d+1 schedule, setup scalars as 0-d arrays, declared scalars expanded over their loop scope), replacing the single binding statement per kernel. Code is generated by ISL (scalars declared in their original scope) and checked against the plain loop-tree baseline. Finds three foralls the old model rejected (durbin i2, gramschmidt i2 and j). Also fixes run_agent/MCP optimize crashing on imperfect kernels (no .ek). Fusion (8): fuse(L) runs a statement inside the previous one's loops, shift(L, c) offsets a loop; multi-statement and stencil kernels then schedule the statement sequence as one union (accesses from the bodies), so e.g. jacobi fuses only after shift(i, 1) and 2mm only at i. Measurement (9): programs print their OpenMP thread count; busy_warning() flags a loaded host (bench, run_agent, MCP); COMPILOT_OMP_BIND=1 opts into pinned threads (off by default: no variance reduction measured on WSL2). Hardening (10): LLM requests connect through a guard that resolves once, refuses link-local addresses and connects to what it checked (closes DNS rebinding and redirects to the metadata endpoint). test_parallel_safety runs at SMALL (minutes -> seconds). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…notes README, how-it-works, architecture and user-guide describe the dataset classes, the union model for imperfect nests and fusion, the fuse/shift DSL ops, thread counts / busy warnings / opt-in pinning, and the new bench flags. The architecture page's single-binding-statement section is replaced by the exact union model. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tness fused_nest passed loop_is_parallel the composite (depth, betas) key where it expects the betas, so the lookup matched no statement and an empty dependence set passed as parallel. test_union caught it through the checksum: jacobi1d parallel(i) on the shifted, fused loop raced. loop_is_parallel now refuses a loop with no statements. Real PolyBench SMALL made the fine-grained wavefront tests (a fork/join per wavefront step) exceed the run timeout: seidel2d/montecarlo/imperfect correctness tests now use MINI with small time-step counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Version bump for the release that ships #32 (ISL codegen from the proven schedule, real tiling, re-measured bests) and this PR (PolyBench datasets, exact union model for imperfect nests, fuse/shift, measurement and connection hardening). Breaking: tile2d/tile3d semantics, generate_c needs poly= for schedules, sizes default to DEFAULT, the npm launcher no longer reads ./.venv. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c46680a99a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…rnels - OpenAI-compatible requests (the base_url an MCP caller picks) ignore HTTP(S)_PROXY: through a proxy the connection guard could only vet the proxy, which would then resolve and fetch a link-local target for us. Gemini (fixed host) still honours proxies. (Codex review, P1) - bench.py/baselines.py: unknown --kernels names are an argument error and an empty result says so, instead of a ZeroDivisionError. (Codex review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
… skip Naive baselines at PolyBench LARGE can exceed the 120 s run timeout (floyd-warshall N=2800 did, aborting bench.py). RUN_TIMEOUT is now configurable (COMPILOT_RUN_TIMEOUT, bench.py/baselines.py --timeout), and a kernel whose baseline or candidate fails is reported as skipped while the rest of the benchmark continues. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0789e85d4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
AWS serves IMDS over IPv6 at fd00:ec2::254 (unique-local, not link-local) and Alibaba Cloud at 100.100.100.200; both passed the link-local checks. llm.is_blocked_address (link-local or METADATA_ADDRESSES, also as IPv4-mapped IPv6) now backs both the early base_url check and the connect-time guard. (Codex review, P1) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21f51fb394
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
--rounds 0 reached ab_speedup and died in statistics.median([]); argparse now rejects non-positive values, and rerun/ab_speedup raise a clear ValueError if called with fewer than one round. (Codex review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5c7549766
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…al nest In the fused path a statement's 2d+1 vector reflects its transforms, so tiling can put parallel(L) deeper than the original nest; loop_members compared against the original labels, found no statement and reported a legal schedule as invalid. Depth is now read from the time vector (n_loops), also for placing statement-declared scalars. (Codex review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
Indicative numbers from the WSL2 host (load average 3.8-10): bench geomean 3.0x over 14 kernels (gemm 10.4x, 2mm 11.7x), and 1.55x over naive auto-parallelization; floyd-warshall at N=2800 exceeds the default run timeout and is reported as skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow-ups to #32: real PolyBench sizes, exact legality for the imperfect-nest solvers, executable
fuse/shift, steadier measurement, and request-time SSRF protection. It also bumps the version to 0.3.0 for the release.What changes
PolyBench datasets.
MINI…EXTRALARGEare now PolyBench/C 4.2.1's exact per-kernel sizes, copied from its headers (gemmLARGE= 1000×1100×1200), instead of scale factors. A newDEFAULTclass keeps each kernel's built-in size and is the default everywhere: agent, MCP, TUI and tests. 3mm, atax, bicg and fdtd-2d now use PolyBench's rectangular shapes. The two non-PolyBench extras still use scale factors.bench.py/baselines.pydefault toLARGE, where locality matters, and gain--size,--roundsand--kernels.tile3d(32, 128, 64): 12.8× confirmed, against 9.8× untiled at LARGE.Exact legality for imperfect nests. The new
compilot/union.pymodels every statement at once and replaces the single "binding" statement per kernel:setupscalars become 0-d arrays, and statement-declared scalars (double w = …) are expanded over their loop scope.The scheduled code is generated by ISL, with those scalars declared in their original scope, and checked against the plain loop-tree baseline. All previous verdicts hold. It also finds three foralls the old model rejected: durbin
i2, gramschmidti2andj.run_agent.py --kernel <solver>and MCPoptimizecrashing on imperfect kernels (no.ek).fuse(L)/shift(L, c). In multi-statement and stencil kernels, a statement can run inside the previous statement's loops. The whole sequence becomes one union, with accesses read from the bodies, so every dependence between statements is checked. Examples:shift(i, 1), andparallel(i)on that fused loop is rejected;ibut not atj;Measurement.
busy_warning()flags a loaded host (1-minute load above half the CPUs) inbench.py,run_agent.pyand MCP results.COMPILOT_OMP_BIND=1opts into pinned threads. It's off by default: on WSL2, 20+20 alternating runs showed no variance reduction (max/min 3.97× pinned vs 2.85× unpinned).Connection guard. LLM requests connect through a guard that resolves the host once, refuses link-local addresses, and connects only to the addresses it checked. This closes DNS rebinding and redirects to the metadata endpoint; the
_check_base_urlcheck stays as the early, readable rejection.test_parallel_safetynow runs atSMALL(4–7 minutes → about 40 s).A bug the tests caught along the way
fused_nestpassedloop_is_parallelthe wrong key. That matched no statements, so an empty dependence set passed as "parallel". The new fusion test caught it through the checksum: jacobi-1d's fused, shiftedparallel(i)raced. Fixed in 27f7739, andloop_is_parallelnow refuses a loop with no statements.Behaviour changes
LARGEexplicitly get much bigger problems.DEFAULTgives the old LARGE sizes.parallelare reportedunsupportedwithout a legality check (it used to run against the binding statement).Testing
test_tiramisu_parityskips itself because libtiramisu isn't built.tests/test_union.py(loop tree, 11 fusion cases).test_imperfect(ISL identity == loop-tree baseline for all 9 kernels, the two new foralls, the prompt-builder fix),test_polybench(160 kernel×dataset instances against PolyBench's tables),test_confirm(thread count, busy warning, opt-in pinning) andtest_review_fixes(connection guard incl. redirect to the metadata endpoint).🤖 Generated with Claude Code