ethdebug: Improve current testing infra#16727
Conversation
4c86c71 to
5186b7e
Compare
nikola-matic
left a comment
There was a problem hiding this comment.
As discussed earlier, can you please migrate the llvm-lit test to the new ethdebug isoltest (#16675 - merged this morning)?
I'll be doing some follow up tasks regarding the ethdebug isoltest, so feel free to let me know if you have any requests :)
There was a problem hiding this comment.
You should be able to get rid of all of these (brink, ens and prb-math), i.e. just drop the commits after a rebase - I fixed these some time ago.
There was a problem hiding this comment.
Very nice, I will do it.
Hi @nikola-matic, thanks for the feedback! Yes sure! I will do it, and also include into CI the ethdebug compilation overhead (almost ready), and of course, if something is missing in the And just to confirm, we do not want to include |
Correct - team is very much used to the isoltest way of doing things, and reviewing will go much smoother with isoltest instead of llvm-lit for the time being. |
5186b7e to
7f45821
Compare
7f45821 to
efaef8d
Compare
|
This PR depends on these changes outside of this repo: |
nikola-matic
left a comment
There was a problem hiding this comment.
Looks good - you went a bit overboard with the CI though :)
| void appendLengthPrefixed(std::string& _target, std::string_view _value) | ||
| { | ||
| _target += std::to_string(_value.size()); | ||
| _target += ":"; | ||
| _target += _value; | ||
| } |
There was a problem hiding this comment.
| void appendLengthPrefixed(std::string& _target, std::string_view _value) | |
| { | |
| _target += std::to_string(_value.size()); | |
| _target += ":"; | |
| _target += _value; | |
| } | |
| std::string lengthPrefixed(std::string_view _value) | |
| { | |
| return fmt::format("{}:{}", _value.size(), _value); | |
| } |
| _target += _value; | ||
| } | ||
|
|
||
| std::string compilationID(std::vector<Source> const& _sources) |
There was a problem hiding this comment.
You could also apply fmt::format here, but it's not a dealbreaker.
| command: | | ||
| pytest test/ethdebugSchemaTests --solc-binary-path=/tmp/workspace/solc/solc-static-linux -v | ||
|
|
||
| t_ethdebug_overhead: |
There was a problem hiding this comment.
I wouldn't add a CI step for benchmarking at this stage - running it on every commit incurs additional cost for us, and the vast majority of PRs will not be touching anything ethdebug related (in terms of the entire repository, ethdebug PRs obviously will).
Also, what would be the failure condition for such a step? I don't see one here - it seems that it only runs the benchmark three times and stores the (average?) result as an artifact.
For the time being, just get rid of all of the CircleCI changes, and instead let's agree to dump the results as a comment in the PR (as a table, or whatever format you deem acceptable).
The extention tot_ethdebug_output_validity is fine.
There was a problem hiding this comment.
Also, what would be the failure condition for such a step? I don't see one here - it seems that it only runs the benchmark three times and stores the (average?) result as an artifact.
For the time being, just get rid of all of the CircleCI changes, and instead let's agree to dump the results as a comment in the PR (as a table, or whatever format you deem acceptable).
Well, this tests the compilation overhead, so definitely it needs to be invoked several times, and to report the if the "overhead" is more than a trash-hold (atm I put > 50%). It could be pretty heavy to keep it as default in the CI, so yes, let's remove it for now.
And this solc-bench-change is the PR that introduces the new benchmark there, so we can discuss the format of the output there, right?
There was a problem hiding this comment.
Please check this: argotorg/solc-bench#12 (comment)
There was a problem hiding this comment.
Given that it would be a bit much to run this in the CI for every push, let's agree to just paste the benchmarking results from solc-bench to solc PRs when they're opened, so we can see the effects.
| { | ||
| schema::materials::Source result; | ||
| result.id = schema::materials::ID{_source.id}; | ||
| result.path = _source.path; | ||
| result.contents = _source.contents; | ||
| result.encoding = std::nullopt; | ||
| result.language = _source.language; | ||
| return result; |
There was a problem hiding this comment.
| { | |
| schema::materials::Source result; | |
| result.id = schema::materials::ID{_source.id}; | |
| result.path = _source.path; | |
| result.contents = _source.contents; | |
| result.encoding = std::nullopt; | |
| result.language = _source.language; | |
| return result; | |
| { | |
| return { | |
| .id = schema::materials::ID{_source.id}, | |
| .path = _source.path, | |
| .contents = _source.contents, | |
| .encoding = std::nullopt, | |
| .language = _source.language, | |
| }; |
c++20 very nice 👍 You can also drop .encoding = std::nullopt, since it'll be default initialized as such.
There was a problem hiding this comment.
okay, I agree, c++20 it is :)
There was a problem hiding this comment.
It seems that CI Windows job rejects C++20
There was a problem hiding this comment.
Bleeeh, this .id = schema::materials::ID{_source.id} is the offender that triggers an ICE in MSVC, and is only fixed in MSVC 19.33 (family 17.3). Unfortunately, this would mean we'd have to bump MSVC from 2019 to 2022, and we're not doing that now.
Revert it back to how it was then.
| for (auto const& source: _sources) | ||
| sources.emplace_back(materialSource(source)); | ||
|
|
||
| schema::materials::Compilation result; |
There was a problem hiding this comment.
Named struct initialization here as well.
| // .compilation.id: <IGNORE> | ||
| // .compilation.sources | length: 1 | ||
| // .compilation.sources[0].id: 0 | ||
| // .compilation.sources[0].path: <IGNORE> |
There was a problem hiding this comment.
You should test this in test/libsolidity/ethdebugTests/multi_source_name_collision.sol and test/libsolidity/ethdebugTests/multi_source.sol as it's multisource with paths.
You can also create a new test if you feel like something is undertested, or the current tests don't allow for the best representation.
There was a problem hiding this comment.
at least for these basic ETHDebug things, no, but in future, once we start adding more complex things into it (like variable values), it will definitely need to evolve a bit.
dcd8d7b to
a5686ef
Compare
Handle multiple things
ethdebugrelated:codegentests as well)soldbviaconformancetests added into theformatrepo