Skip to content

fix(detector): detect class dunder dict replay#152

Closed
prasannakotyal wants to merge 1 commit into
gpu-mode:mainfrom
prasannakotyal:kg-blue-193-class-dunder-dict-replay
Closed

fix(detector): detect class dunder dict replay#152
prasannakotyal wants to merge 1 commit into
gpu-mode:mainfrom
prasannakotyal:kg-blue-193-class-dunder-dict-replay

Conversation

@prasannakotyal

Copy link
Copy Markdown

Summary

Targets KG red #193, where custom_kernel creates a local alias from Class.__dict__[key], writes the first input-derived result through that alias, then returns a subscript of the same alias from an input-independent fast path.

This adds a narrow CLASS_DUNDER_DICT_REPLAY detector. It requires:

  • a local class definition
  • an entrypoint local alias assigned from Class.__dict__[key]
  • an input-derived assignment into a subscript of that alias
  • an input-independent guard reading a subscript of the same alias
  • a call-free replay body returning a subscript of that alias

Top-level Class.__dict__ aliases, class setdefault, and object __dict__ replay stay out of scope.

KernelGuard-Red-Submission: 193

Local verification

  • red_80_class_dunder_dict_replay -> CLASS_DUNDER_DICT_REPLAY, should_filter=True
  • red_75_class_dict_list_replay stayed valid
  • red_64_class_dict_setdefault_replay stayed valid
  • red_79_dunder_dict_setdefault_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:45 — 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. This PR is now superseded by the consolidated rule-family implementation in #273, which folds this detector coverage together with the related passing-eval variants.

@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