Repository navigation
Fix lost interactions in the box scanner sweep - #2547
Closed
nikosavola wants to merge 3 commits into
Closed
nikosavola wants to merge 3 commits into
nikosavola wants to merge 3 commits into
Conversation
The tests compare both scanners with a brute force check on many small random inputs and a few picked ones, with the threshold set so that the sweep is always used.
A leftover loop inserted every text again for each subject it touches. The filter skips texts it has already output, so this only cost time.
The sweep remembered reported pairs in a set keyed on the object pointers only. When the same object was inserted twice with different properties, the second pair was dropped. This only happened above the scanner threshold. See KLayout#2546. A pair is now reported in the band and window where it is first tested, so the set is not needed any more.
Contributor
Author
|
With this branch, the check from the script in #2546 finds no missing marker edges in the deep run, against 3115 on current master. |
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.
Fixes #2546. The box scanner sweep kept the pairs it had reported in a set keyed on the two object pointers. If the same object is inserted twice with different properties, as in the instance to shape interaction scan, the second pair was dropped. The brute force path below the scanner threshold reports both, so the result depended on how many shapes a cell has.
The sweep needed the set because it tests the same pair more than once. Two boxes meet again in every band they share, and in the two collection scanner also in every window they share.
Now a pair is reported only where it is first tested. In y that is the band where the later of the two enters, so its bottom is above the previous band edge. Both are still in the sweep there, because an element is only dropped when it can no longer overlap anything that enters later. Windows work the same way in x. The single scanner already paired the new elements of a window only with earlier ones, so it only needed the band check. In the two collection scanner the new elements of a window are the ones added after the partition, since the partition only reorders the older ones. So each overlapping pair is reported exactly once without the set.
The text pull had a leftover loop that inserted each text again for every subject it touches. Its filter skips texts it has already output, so the loop only cost time and is removed. Dropping the set also saves time and memory, since it held a node for every reported pair. On the vexriscv deep DRC run below both roughly halve.
In the clipped run, a build that always uses the brute force loop also gives 4296 markers. The full run doesn't hit the bug, and its output matches master. The new tests compare both scanners with brute force on many small random inputs, including repeated objects, empty boxes, touching edges and various enlargements and fill factors.