fix(detector): direction coverage — JOIN/CONCAT-built dynamic dispatch detector#23
Closed
SinatrasC wants to merge 1 commit into
Closed
fix(detector): direction coverage — JOIN/CONCAT-built dynamic dispatch detector#23SinatrasC wants to merge 1 commit into
SinatrasC wants to merge 1 commit into
Conversation
Targets red #125 ('Token-paste / filter evasion'). Live KG (0.2.2) calls this valid: def custom_kernel(data): name = ''.join(['e', 'x', 'e', 'c']) f = __builtins__[name] if isinstance(__builtins__, dict) else getattr(__builtins__, name) f('pass') return data.clone() The literal 'exec' never appears in source, so the existing detect_dynamic_execution Call-walking pass finds nothing. Approach: add two detection branches in the same family as the chr-concat rule (PR #15). Both flag piecewise string construction with >=3 short- literal pieces, regardless of whether the result feeds into a dynamic- dispatch site or not - that level of fragmentation has no legitimate use in numerical kernels. * '".join([Constant, Constant, ...])' with all short-literal elts and len >= 3 * 'BinOp(Add, ...)' chain whose leaves are all short-literal Constants and chain length >= 4 Verified locally: red #125 flagged, all 5 legit corpus cases stay valid, classic LAST_CALL_REPLAY still flagged. The 5 other directions' reds are untouched (they need their own per-direction patches).
KernelGuard Blue Evaluation
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Targets KG red #125 under "Direction — Token-paste / filter evasion in C++". Coverage example for the previously-empty direction; the red was submitted via the direct API path and is currently
red_accepted: 1on the live leaderboard.Targets red #125 (filter-evasion via piecewise string construction).
This blue: JOIN/CONCAT-built dynamic dispatch detector.
Local verification
Patch was verified locally against a corpus that exercises:
plain_kernel,workspace_lazy,shape_dispatch,config_lookup,triton_jit_kernel) — all stay validKernelGuard-Red-Submission: 125