New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ATM: Remove redundant code #11321
Open
tiferet
wants to merge
5
commits into
tiferet/endpoint-filters
Choose a base branch
from
tiferet/complexity-reduction
base: tiferet/endpoint-filters
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
ATM: Remove redundant code #11321
+220
−568
Conversation
This file contains 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
tiferet
commented
Nov 17, 2022
...l/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/EndpointCharacteristics.qll
Show resolved
Hide resolved
e6c76a5
to
9a37061
Compare
`isOtherModeledArgument` and `isArgumentToBuiltinFunction` contained the old logic for selecting negative endpoints for training. These can now be deleted, and replaced by a single base class that collects all EndpointCharacteristics that are currently used to indicate negative training samples: `OtherModeledArgumentCharacteristic`. This in turn lets us delete code from `StandardEndpointFilters` that effectively said that endpoints that are high-confidence non-sinks shouldn't be scored at inference time, either.
All remaining functionality in `CoreKnowledge` is only being used in `EndpointCharacteristics`, so it can be moved there as a small set of helper predicates.
All remaining functionality in `StandardEndpointFilters` is only being used in `EndpointCharacteristics`, so it can be moved there as a small set of helper predicates.
9a37061
to
fac6641
Compare
kaeluka
reviewed
Nov 22, 2022
This is the kind of PR where I'm extra glad we have CI checks: big surface, but not much new logic ;)
I'll give this a formal approval once the first PR is merged and this has been rebased; but I've done the review now and it all looks good to me. I've left one question for my own understanding.
...l/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/EndpointCharacteristics.qll
Show resolved
Hide resolved
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.
This PR is the code cleanup made possible by the previous few PRs. As such, it has a lot of lines of change (mostly code deletion🥳 ), but the changes are conceptually small. I tried to make the commits as clear as possible, tackling one piece of complexity reduction per commit, and explaining it in the commit comment. Commit-by-commit review warmly recommended 😄
Note that this PR is based on the branch
tiferet/endpoint-filters, because that branch has not yet been merged and I don't want to see the commits from #11281 in this PR as well.main code deletions / simplifications
isOtherModeledArgumentandisArgumentToBuiltinFunctioncontained the old logic for selecting negative endpoints for training. These can now be deleted, and replaced by a single base class that collects all EndpointCharacteristics that are currently used to indicate negative training samples:OtherModeledArgumentCharacteristic. This in turn lets us delete code fromStandardEndpointFiltersthat effectively said that endpoints that are high-confidence non-sinks shouldn't be scored at inference time, either.FilteringReasonis no longer being used and can be deleted.CoreKnowledgeandStandardEndpointFilters: All remaining functionality inCoreKnowledgeandStandardEndpointFiltersis only being used inEndpointCharacteristics, so it can be moved there as a small set of helper predicates.Timing checks
endpoint_large_scale/ExtractEndpointDataTrainingremains like it was after the last PR that affected timing: About 5s.Closes github/ml-ql-adaptive-threat-modeling#2110