Skip to content

fix(detector): detect bool method replay#153

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

fix(detector): detect bool method replay#153
prasannakotyal wants to merge 1 commit into
gpu-mode:mainfrom
prasannakotyal:kg-blue-195-bool-method-replay

Conversation

@prasannakotyal

Copy link
Copy Markdown

Summary

Targets KG red #195, where custom_kernel uses a custom object's __bool__ method as the replay guard, then returns state stored inside that same object from the first input.

This adds a narrow BOOL_METHOD_REPLAY detector. It requires:

  • a local class defining __bool__
  • a module-level instance of that class
  • an entrypoint mutating one of that instance's attribute containers from input-derived data
  • an input-independent truthiness guard over the same instance
  • a call-free replay body returning a subscript of the same attribute container

Plain bool holder lists, bool(tuple_state), and bool(dict_values) replay stay out of scope.

KernelGuard-Red-Submission: 195

Local verification

  • red_81_bool_method_replay -> BOOL_METHOD_REPLAY, should_filter=True
  • red_66_bool_holder_replay stayed valid
  • red_297_tuple_bool_replay stayed valid
  • red_296_bool_dict_values_replay stayed valid
  • 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 2, 2026 04:47 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented May 2, 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