| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Cost of contract calls snapshot tests (#7440) ## Description This PR is a prequel for https://github.com/FuelLabs/sway/pull/7419. It will set the baseline, which future PRs need to improve. Apart from that it also: 1 - Fix a problem with `SubtsType` for `TyConstantDecl`; 2 - Introduce a new way to write snapshot tests. Now the test source code can have "blocks" ``` /* START BOOL */ fn in_bool(v: bool) -> bool; /* END BOOL */ ``` These blocks can be manipulated from inside the `snapshot.toml`. In this case, the `toml` is: ``` cmds = [ "forc test --path {root} --release --experimental const_generics", { repeat = "for-each-block", cmds = [ "forc test --path {root} --release --experimental const_generics" ] } ] ``` Which repeats the inner `forc test` for each block, removing all others. That allows me to check the cost of the contract method selection algorithm for each contract method. For example, `cost_of_in_array_64` with all other contract methods costs `60382`, but alone it only costs `58218`, which means that around 2000 was "wasted" in the contract method selection. ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [x] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers. | 10 个月前 | |
Add `--perf` option to `test` to collect and diff performance data (#7459) ## Description This PR: - Adds `--perf` and `--perf-only` options to `test` to collect gas usages and bytecode sizes, and to run only the tests that actually produce those performance data, respectively. - Adds `[performance]` recipes to `justfile` that fully automate a workflow for collecting and comparing performance data of the compiler output. `--perf` flag instructs `test` to collect performance data from tests of categories `compile`, `run`, and `unit_tests_pass`. Collected gas usages and bytecode sizes are written to files named `<timestamp>-<category>-<build profile>-<branch>.csv`. E.g.: `1020165605-e2e-bytecode-sizes-release-master.csv`. When running tests in parallel (default option), performance data of each individual `test --exact <test_toml_path>` process is written to a piped stdout in JSON format. The main `test` process collects those JSON outputs from all spanned processes. The usual workflow of collecting and comparing performance data between the `master` and feature branch is supported by the following `just` recipes: ```console [performance] perf-e2e filter='' # collect gas usages and bytecode sizes from E2E tests [alias: pe2e] perf-in-lang filter='' # collect gas usages from in-language tests [alias: pil] perf-all filter='' # collect gas usages and bytecode sizes from all tests (E2E and in-language) [alias: pa] perf-diff before after format='md' # generate performance diff between two CSV files [alias: pd] perf-diff-latest format='md' # generate performance diffs between the latest two CSV files per testing category [alias: pdl] perf-snapshot-historical path open='' # collect historic gas usages from a snapshot test that has a `forc test` output [alias: psh] perf-list # list all performance files (*gas-usages-*.* and *bytecode-sizes-*.*) [alias: pl] perf-remove # remove all performance files (*gas-usages-*.* and *bytecode-sizes-*.*) [alias: pr] ``` To obtain the performance comparison it is enough to run: ```console just pa // `just perf-all`. On `master` to get the baseline. just pa // `just perf-all`. On the feature branch to get the improved data. just pdl // `just perf-diff-latest`. To get the diff of the last two collected performance data sets. ``` The `just` recipes should be executed from the root of the Sway repository. Aside from `--perf` writing to predefined files, all other parts of the workflow are `just` recipes and can potentially be tailored to any other workflow. Adding support for collecting gas usages and bytecode sizes from other tests like (snapshot, in-language, SDK harness) will be added in follow up PRs. ## Checklist - [ ] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers. | 10 个月前 | |
Add CI check to ensure forc-fmt doesn't panic (#5051) ## Description Closes https://github.com/FuelLabs/sway/issues/5006 ## Checklist - [x] I have linked to any relevant issues. - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [ ] I have requested a review from the relevant team or maintainers. | 2 年前 | |
`forc doc`: Generate dependency documentation (#4546) ## Description Generates the documentation for dependencies & small improvements to the API. These changes **DO NOT** create links between dependency docs and the main docs, but generates the dependency docs and ensures there are no conflicts when generating these docs. What's new so far: - [x] Programs get their own folders, just like `cargo doc` - [x] Generates documentation for dependencies by default: Closes #4533 - [x] Fixes possible conflict with `assets` folder: Closes #4545 - [x] Removes old docs before generating new ones: Closes #4544 ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [x] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] I have added tests that prove my fix is effective or that my feature works. - [x] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers. --------- Co-authored-by: Chris O'Brien <eureka@noctua.attlocal.net> | 3 年前 | |
chore: bumpt rust version to 1.90 (#7427) ## Description Bumping the rust version to 1.90 and fixing the clippy lints along the way | 10 个月前 | |
Extract all perf data from in-language tests run in parallel (#7670) ## Description This PR: - implements extraction of performance data from in-language tests when they are run in parallel. - implements extraction of bytecode sizes from in-language tests. - fixes the `--filter` passing issue in `justfile` discussed in https://github.com/FuelLabs/sway/pull/7669#discussion_r3488023317. ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers. | 2 个月前 | |
Create markdown-lint.yml (#2534) * Create markdown-lint.yml * Fix lint errors. | 3 年前 | |
Refactor `DeclEngine` for robustness and semantic consistency (#7704) ## Description This PR is a prerequisite for an upcoming performance optimization of the `DeclEngine`, aimed at additional removals of copied `TyDecl` entries from the `DeclEngine`. The PR: - properly implements `HasChanges` for `MaterializeConstGenerics::materialize_const_generics`. During compilation of the o2 `order-book` contract, this change removes 104 duplicated function decls and 894 duplicated struct decls. - removes `insert_arc` from the `DeclEngine`. The semantic of this method made no sense for its existing usages. In all usages, we were inserting an existing declaration gotten from the `DeclEngine` and just giving it a different `DeclId`. In other words, calling `DeclEngine::get_...` would for both `DeclId`s return exactly the same declaration. Additionally, all those usages were only in ABI declarations, for ABI's `TyImplItem::Fn/Constant/Type` where none of those can be modified afterwards in any way (e.g., we do not support them being generic in ABIs). As expected, removing `insert_arc` and replacing its returned `DeclRef` with the original didn't change semantic of any calls that were using it. - adds `insert_modified` method to the `DeclEngine` and forces `insert` to provide `ParsedDeclId`. Previous approach in which callers were responsible for either passing the `ParsedDeclId` for the first time or getting it by `get_parsed_decl_id` was both verbose and error-prone. There were cases in code, some even marked with TODO, where the `ParsedDeclId` was not provided when inserting a modified declaration, essentially inserting declarations that were not connected to their parsed equivalents. - adds `insert_dummy_func` method to the `DeclEngine` to clearly distinguish the only case in which a typed declaration does not have the corresponding parsed declaration. - fixes the bug of having two different fields for parsed const generics in the `DeclEngine`: `const_generic_parsed_decl_id_map` and `const_generic**s**_parsed_decl_id_map`. The plural version was used for writing and singular for reading, effectively resulting in const generics never having their corresponding parsed declarations attached. - wires all instances of `ConstGenericParameter` with their corresponding `ParsedDeclId`s. Previously this was done for const generics in functions and impls, but not in structs, enums, and traits. Additionally, the PR: - adds `run-tests.sh` and `just t` recipe for convenient running of the base set of Sway compiler tests. ## Checklist - [ ] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers. | 28 天前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 10 个月前 | ||
| 10 个月前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 10 个月前 | ||
| 2 个月前 | ||
| 3 年前 | ||
| 28 天前 |