79324920f7
Certain mutation testing -- mutateOperandLifeTimeTest and mutateOperandInputOutputTest -- can introduce potentially very large CONSTANT_COPY operands, which can in turn create potentially very large Models which must be passed across binder. To avoid overflowing the binder buffer, we estimate the size of the mutated Model, and skip the test if that size is too high. The old logic recognizes that our tests only have a single active binder transaction at a time, and assumes that there are no other clients using the same service at the same time, and so we should have the binder buffer to ourselves; to be conservative, we reject any Model whose estimated size exceeds half the binder buffer size. Unfortunately, sometimes the binder buffer still overflows, because it unexpectedly contains an allocation from some other transaction: It appears that binder buffer memory management is not serialized with respect to transactions from our tests, and therefore depending on scheduler behavior, there may be a sizeable allocation still in the buffer when we attempt to pass the large Model. To fix this problem we become even more conservative, and instead of limiting the Model to half the binder buffer size, we limit it to half IBinder.MAX_IPC_SIZE (the recommended transaction size limit). To confirm that this change does not exclude too many tests, I checked how may times the size filter function exceedsBinderSizeLimit is called, how many times it rejects a model under the new logic (modelsExceedHalfMaxIPCSize), and how many times it rejects a model under the old logic (modelsExceedHalfMaxIPCSize). Test: VtsHalNeuralnetworksV1_0TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp* Test: # models = 3592, modelsExceedHalfMaxIPCSize = 212, modelsExceedHalfBufferSize = 18 Test: VtsHalNeuralnetworksV1_1TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp* Test: # models = 7228, modelsExceedHalfMaxIPCSize = 330, modelsExceedHalfBufferSize = 28 Test: VtsHalNeuralnetworksV1_2TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp* Test: # models = 52072, modelsExceedHalfMaxIPCSize = 506, modelsExceedHalfBufferSize = 28 Test: VtsHalNeuralnetworksV1_3TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp* Test: # models = 73342, modelsExceedHalfMaxIPCSize = 568, modelsExceedHalfBufferSize = 28 Test: VtsHalNeuralnetworksTargetTest Bug: 227719657 Bug: 227719752 Bug: 231928847 Bug: 238777741 Bug: 242271308 Change-Id: I3f81d71ca3c0ad4c639096b1dc034a8909bc8971 |
||
---|---|---|
.. | ||
1.0 | ||
1.1 | ||
1.2 | ||
1.3 | ||
aidl | ||
utils | ||
README | ||
TEST_MAPPING |
NeuralNetworks sample driver implementation is located at frameworks/ml/nn/driver/sample.