Skip to content

fix(detector): detect bound method replay#124

Closed
prasannakotyal wants to merge 1 commit into
gpu-mode:mainfrom
prasannakotyal:kg-blue-144-bound-method-replay
Closed

fix(detector): detect bound method replay#124
prasannakotyal wants to merge 1 commit into
gpu-mode:mainfrom
prasannakotyal:kg-blue-144-bound-method-replay

Conversation

@prasannakotyal

Copy link
Copy Markdown

Summary

Targets KG red #144, where custom_kernel is assigned to a bound instance method. The method saves the first input-derived result on self, then later returns that instance attribute from a call-free fast path.

This adds a narrow BOUND_METHOD_REPLAY detector. It requires:

  • a top-level custom_kernel = K().run or custom_kernel = instance.run assignment
  • a concrete class method behind that bound method
  • a call-free early return of self.<attr>
  • the same self.<attr> referenced by the replay guard
  • an assignment to that attribute from a call involving an input parameter

Normal bound methods that compute from the current input, or methods that cache constant/config state, stay out of scope.

KernelGuard-Red-Submission: 144

Local verification

  • red_24_bound_method_replay -> BOUND_METHOD_REPLAY, should_filter=True
  • local red fixture sweep only triggered this new detector on red_24_bound_method_replay
  • clean fixtures in eval_blue_patch.py stayed valid
  • uv run python -m py_compile kernelguard.py

@prasannakotyal prasannakotyal temporarily deployed to kernelguard-api-control-plane May 1, 2026 23:48 — 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

Thanks for the KernelGuard Flywheel Campaign contribution. We are not merging this narrow variant separately because the consolidated rule-family implementation in #273 is the merge path for this detector area.

@SinatrasC SinatrasC closed this Jun 20, 2026
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.

2 participants