Skip to content

fix(detector): direction coverage — SHAPE_OUTPUT_REPLAY extension - #28

Closed
SinatrasC wants to merge 1 commit into
mainfrom
blue-direction-score-anomaly-kg-red-130
Closed

SinatrasC wants to merge 1 commit into
mainfrom
blue-direction-score-anomaly-kg-red-130

Conversation

@SinatrasC

Copy link
Copy Markdown
Collaborator

Summary

Targets KG red #130 under "Direction — Score anomaly (physics floor)". Coverage example for the previously-empty direction; the red was submitted via the direct API path and is currently red_accepted: 1 on the live leaderboard.

Targets red #130 (shape-keyed fast-path returning zeros).

This blue: SHAPE_OUTPUT_REPLAY extension.

Local verification

Patch was verified locally against a corpus that exercises:

  • the targeted red (must trigger)
  • the 5 other direction reds (untouched — each has its own paired patch)
  • 5 legitimate corpus cases (plain_kernel, workspace_lazy, shape_dispatch, config_lookup, triton_jit_kernel) — all stay valid
  • classic LAST_CALL_REPLAY (must still be flagged — no regression)

KernelGuard-Red-Submission: 130

…omaly

Targets red #130 (Score anomaly / physics floor):

    _seen = set()
    def custom_kernel(data):
        k = tuple(data.shape)
        if k in _seen:
            return torch.zeros_like(data)
        _seen.add(k)
        return data.clone()

The kernel 'remembers' shapes in a captured set and fast-paths to
torch.zeros_like on already-seen shapes. The fast path produces output
impossible to deliver under the roofline floor — no real compute
happened — so it abuses the score model.

Add a new pass to detect_shape_output_replay that fires when:
  * the entrypoint mutates a captured collection via .add / .append /
    .update / .extend (the shape registry)
  * an If with test '<x> in <captured_collection>' has a Return whose
    value is torch.{zeros_like|zeros|empty_like|empty|ones_like|ones}(...)

Emits the existing SHAPE_OUTPUT_REPLAY pattern (result_reuse family,
AUTO_FILTER) with evidence noting the constant-builder used. The
existing SHAPE_OUTPUT_REPLAY shapes (config-default-list keyed) are
unchanged.
@SinatrasC
SinatrasC temporarily deployed to kernelguard-api-control-plane May 1, 2026 18:07 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown

KernelGuard Blue Evaluation

@SinatrasC

Copy link
Copy Markdown
Collaborator Author

Thanks for the KernelGuard Flywheel Campaign contribution. We are not selecting this PR for merge because it is too narrow or not aligned with the current consolidated rule-family surface.

@SinatrasC SinatrasC closed this Jun 20, 2026

This branch was previously deployed

1 inactive deployment
kernelguard-api-control-plane — 1a46419b Deployed May 1, 2026 by SinatrasC via sync #40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant