RESOLVED WONTFIX 152419
Add BinarySnippetTester for verifying binary snippet fast path results.
https://bugs.webkit.org/show_bug.cgi?id=152419
Summary Add BinarySnippetTester for verifying binary snippet fast path results.
Mark Lam
Reported 2015-12-17 23:13:31 PST
This is a testing infrastructure that uses MASM probes to automatically compare the snippet fast path results with an equivalent evaluation performed using a C++ function.
Attachments
proposed patch. (38.52 KB, patch)
2015-12-17 23:26 PST, Mark Lam
no flags
proposed patch with typo fix. (38.52 KB, patch)
2015-12-17 23:29 PST, Mark Lam
mark.lam: review-
Mark Lam
Comment 1 2015-12-17 23:26:55 PST
Created attachment 267613 [details] proposed patch.
WebKit Commit Bot
Comment 2 2015-12-17 23:29:28 PST
Attachment 267613 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/jit/BinarySnippetTester.h:56: Wrong number of spaces before statement. (expected: 16) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/BinarySnippetTester.h:57: Wrong number of spaces before statement. (expected: 16) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/BinarySnippetTester.h:58: Wrong number of spaces before statement. (expected: 16) [whitespace/indent] [4] Total errors found: 3 in 14 files If any of these errors are false positives, please file a bug against check-webkit-style.
Mark Lam
Comment 3 2015-12-17 23:29:40 PST
Created attachment 267614 [details] proposed patch with typo fix.
WebKit Commit Bot
Comment 4 2015-12-17 23:32:00 PST
Attachment 267614 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/jit/BinarySnippetTester.h:56: Wrong number of spaces before statement. (expected: 16) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/BinarySnippetTester.h:57: Wrong number of spaces before statement. (expected: 16) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/BinarySnippetTester.h:58: Wrong number of spaces before statement. (expected: 16) [whitespace/indent] [4] Total errors found: 3 in 14 files If any of these errors are false positives, please file a bug against check-webkit-style.
Geoffrey Garen
Comment 5 2015-12-18 10:00:55 PST
Comment on attachment 267614 [details] proposed patch with typo fix. I really don't like fiddly testing mechanisms like this, which require significant low-level coding, and intrusive adoption inside the tested code. If we did all our testing like this, the code base would be completely unintelligible. Also, since the test code is equally low-level to the code being tested, any failure has equal probability to be a failure in the test code or a failure in the tested code. Also, since the test code is embedded in the code being tested, if we change the engine significantly, we may lose test coverage (whereas a test written in client code or in JavaScript can last basically forever).
Mark Lam
Comment 6 2015-12-18 10:29:01 PST
(In reply to comment #5) > Comment on attachment 267614 [details] > proposed patch with typo fix. > > I really don't like fiddly testing mechanisms like this, which require > significant low-level coding, and intrusive adoption inside the tested code. > > If we did all our testing like this, the code base would be completely > unintelligible. Also, since the test code is equally low-level to the code > being tested, any failure has equal probability to be a failure in the test > code or a failure in the tested code. Also, since the test code is embedded > in the code being tested, if we change the engine significantly, we may lose > test coverage (whereas a test written in client code or in JavaScript can > last basically forever). This is the trade off between white box and black box testing. The tests that you favor are black box tests and do indeed have the advantages that you speak of. And yes, the disadvantages you spoke of for the test mechanism in this patch are the disadvantages of white box tests (which are necessarily closely coupled with the code being tested). The advantages of white box tests though are that they fail fast at the direct point of failure. That's why they proved useful to me when I was debugging failures that manifested while running benchmarks (or other similarly large workloads) but that did not manifest when running our test suites. This targeted test mechanism is more powerful as a debugging aid than the black box tests. And yes, I did enhance our (black box) test suite coverage with the missing cases thereafter. I think that both types of tests can be valuable. But if you think this patch pollutes the readability of the code too much, I can stick with manually applying this patch every time I need this functionality.
Mark Lam
Comment 7 2016-09-29 12:30:25 PDT
We're not doing this.
Note You need to log in before you can comment on or make changes to this bug.