Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"other" op code sanity check #1476

Merged
merged 50 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
8df83c3
WIP add infra for contract testing
MitchTurner Oct 25, 2023
333e74a
Restructure new bench infra, add stalling `call` bench
MitchTurner Oct 26, 2023
8fd9633
Merge branch 'master' into contract-op-code-sanity-check
MitchTurner Oct 26, 2023
864fe3b
Fix insert
MitchTurner Oct 27, 2023
1fe61c6
WIP debugging stalling benchmark
MitchTurner Oct 27, 2023
39be18e
Get simple bench working
MitchTurner Oct 27, 2023
b79b577
Get call bench actually working!
MitchTurner Oct 28, 2023
0def296
Add range of contract sizes for `call` benches
MitchTurner Oct 30, 2023
773b8e1
Add `bal` benches
MitchTurner Oct 30, 2023
dc2aa9d
Finish simple benches, bring over example code for complex ones
MitchTurner Oct 30, 2023
7e4c311
WIP add new methods without verification
MitchTurner Oct 31, 2023
31fa121
WIP Fix some compelation
MitchTurner Oct 31, 2023
919127f
WIP Fix some benches, add more
MitchTurner Nov 1, 2023
e58abf7
Add `scwq` bench, but comment out because undercosted
MitchTurner Nov 2, 2023
e43b05b
Add all but tro and other sequential
MitchTurner Nov 2, 2023
1b89fb7
Fix all but smo and tro
MitchTurner Nov 2, 2023
dd62a49
Merge branch 'master' into contract-op-code-sanity-check
MitchTurner Nov 2, 2023
0769262
Cleanup comments, update CHANGELOG
MitchTurner Nov 2, 2023
7cc0428
Fix smo
MitchTurner Nov 2, 2023
c51a092
Comment out `tro`
MitchTurner Nov 3, 2023
48ad913
Add sequential op code benches but just comment out
MitchTurner Nov 3, 2023
90db502
Fix compilation warnings
MitchTurner Nov 3, 2023
b8195ba
Revert bad fmt
MitchTurner Nov 3, 2023
ef78901
Replace removed changelog entries
MitchTurner Nov 3, 2023
faa299c
Pick some nits
MitchTurner Nov 3, 2023
e8b041d
Add docs to helper functions
MitchTurner Nov 3, 2023
88bab84
Fix name, comment out sequential op bench
MitchTurner Nov 3, 2023
6d952b7
Removed unused function, remove dbg
MitchTurner Nov 3, 2023
72319ee
Appease Clippy-sama
MitchTurner Nov 3, 2023
6ee19be
Update benches/benches/block_target_gas.rs
MitchTurner Nov 8, 2023
8fd7b89
remove dum comments
MitchTurner Nov 8, 2023
d811014
Merge branch 'master' into contract-op-code-sanity-check
MitchTurner Nov 8, 2023
b14aecb
Update CHANGELOG
MitchTurner Nov 8, 2023
f26ec0d
Remove mistake
MitchTurner Nov 8, 2023
0174f5e
Add flag bench
MitchTurner Nov 8, 2023
b70a806
Refactor, add new bench, add comments for missing benches
MitchTurner Nov 8, 2023
5d98e5d
Update CHANGELOG
MitchTurner Nov 8, 2023
65c351e
remove redundant helpers
MitchTurner Nov 8, 2023
f14aa0d
Refactor into factory thing, address some PR reviews
MitchTurner Nov 10, 2023
a3f7060
Add all review changes but `tro` stuff
MitchTurner Nov 14, 2023
afc9488
Merge branch 'master' into contract-op-code-sanity-check
xgreenx Nov 15, 2023
a66e197
Merge remote-tracking branch 'origin/master' into contract-op-code-sa…
xgreenx Nov 15, 2023
a3936c1
WIP fixing `tro`
MitchTurner Nov 15, 2023
b40f617
Merge remote-tracking branch 'origin/contract-op-code-sanity-check' i…
xgreenx Nov 15, 2023
37bfa17
Add incrementing u256 storage key
xgreenx Nov 15, 2023
e24af3e
Use updated costs for sequential opcodes.
xgreenx Nov 15, 2023
fc237c3
Merge branch 'contract-op-code-sanity-check' into other-op-code-sanit…
xgreenx Nov 15, 2023
bb94c75
Merge master but still requires adoption of the other tests
xgreenx Nov 15, 2023
445cf06
Merge remote-tracking branch 'origin/master' into other-op-code-sanit…
xgreenx Nov 15, 2023
8c9d0a3
Use new model and rerun to ensure is still working
MitchTurner Nov 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Description of the upcoming release here.

### Added

- [#1488](https://github.com/FuelLabs/fuel-core/pull/1488): Add docker login for cross binaries that use docker
- [#1485](https://github.com/FuelLabs/fuel-core/pull/1485): Prepare rc release of fuel core v0.21
- [#1476](https://github.com/FuelLabs/fuel-core/pull/1453): Add the majority of the "other" benchmarks for contract opcodes.
- [#1453](https://github.com/FuelLabs/fuel-core/pull/1453): Add the majority of the "sanity" benchmarks for contract opcodes.
- [#1473](https://github.com/FuelLabs/fuel-core/pull/1473): Expose fuel-core version as a constant
- [#1469](https://github.com/FuelLabs/fuel-core/pull/1469): Added support of bloom filter for RocksDB tables and increased the block cache.
Expand Down
33 changes: 18 additions & 15 deletions benches/benches/block_target_gas.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use crate::block_target_gas_set::default_gas_costs::default_gas_costs;
use block_target_gas_set::{
alu::run_alu,
contract::run_contract,
crypto::run_crypto,
flow::run_flow,
memory::run_memory,
other::run_other,
};
use criterion::{
criterion_group,
Expand All @@ -13,16 +15,16 @@ use criterion::{
Criterion,
};
use ed25519_dalek::Signer;
use fuel_core::service::{
config::Trigger,
Config,
FuelService,
ServiceTrait,
};
use rand::SeedableRng;

use ethnum::U256;
use fuel_core::txpool::types::Word;
use fuel_core::{
service::{
config::Trigger,
Config,
FuelService,
ServiceTrait,
},
txpool::types::Word,
};
use fuel_core_benches::*;
use fuel_core_chain_config::ContractConfig;
use fuel_core_storage::{
Expand Down Expand Up @@ -67,17 +69,16 @@ use fuel_core_types::{
consts::WORD_SIZE,
},
};

mod utils;

mod block_target_gas_set;

use crate::block_target_gas_set::default_gas_costs::default_gas_costs;
use rand::SeedableRng;
use utils::{
make_u128,
make_u256,
};

mod utils;

mod block_target_gas_set;

// Use Jemalloc during benchmarks
#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
Expand Down Expand Up @@ -462,6 +463,8 @@ fn block_target_gas(c: &mut Criterion) {

run_memory(&mut group);

run_other(&mut group);

group.finish();
}

Expand Down
2 changes: 2 additions & 0 deletions benches/benches/block_target_gas_set/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ pub mod contract;

pub mod memory;

pub mod other;

pub mod default_gas_costs;
41 changes: 41 additions & 0 deletions benches/benches/block_target_gas_set/other.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
use crate::*;

// ECAL
// FLAG
// GM
// GTF

pub fn run_other(group: &mut BenchmarkGroup<WallTime>) {
let contract_id = ContractId::zeroed();
let asset_id = AssetId::zeroed();
let script_data = script_data(&contract_id, &asset_id);
let mut shared_runner_builder = SanityBenchmarkRunnerBuilder::new_shared(contract_id);
// run_group_ref(
// &mut c.benchmark_group("flag"),
// "flag",
// VmBench::new(op::flag(0x10)),
// );
run(
"other/flag",
group,
vec![op::flag(0x10), op::jmpb(RegId::ZERO, 0)],
vec![],
);

// ecal: Skipped because it would exit the VM

// gm
{
let contract_instructions = vec![op::gm(0x10, 1), op::jmpb(RegId::ZERO, 0)];

let mut instructions = setup_instructions();
instructions.extend(vec![op::call(0x10, RegId::ZERO, 0x11, 0x12)]);

let id = "other/gm";
shared_runner_builder
.build_with_new_contract(contract_instructions)
.run(id, group, instructions, script_data.clone());
}

// gtf: TODO: As part of parent issue (https://github.com/FuelLabs/fuel-core/issues/1386)
}