From 75f1c8f76ade7049800bc4a198a7333b67133c71 Mon Sep 17 00:00:00 2001 From: Ulan Degenbaev Date: Wed, 15 May 2024 11:41:20 +0000 Subject: [PATCH] chore: fix capitalization of "Wasm" --- .../fuzz_targets/compile_wasm_using_embedder.rs | 2 +- rs/embedders/fuzz/fuzz_targets/ws2wasm.rs | 6 +++--- rs/embedders/src/wasm_utils/decoding.rs | 2 +- rs/embedders/src/wasm_utils/instrumentation.rs | 2 +- rs/embedders/tests/misc_tests.rs | 2 +- rs/embedders/tests/wasmtime_embedder.rs | 2 +- .../benches/management_canister/utils.rs | 2 +- .../benches/wasm_instructions/WASM_BENCHMARKS.md | 2 +- .../benches/wasm_instructions/WASM_COVERAGE.md | 2 +- .../benches/wasm_instructions/basic.rs | 2 +- .../benches/wasm_instructions/main.rs | 2 +- .../wasm_instructions/run_wasm_benchmarks.sh | 4 ++-- .../run_wasm_benchmarks_forever.sh | 2 +- .../benches/wasm_instructions/simd.rs | 2 +- .../benches/wasm_instructions/wasm_coverage.sh | 16 ++++++++-------- .../src/canister_manager/tests.rs | 2 +- .../src/execution/upgrade/tests.rs | 6 +++--- .../execution_environment/tests/compilation.rs | 4 ++-- rs/execution_environment/src/history.rs | 4 ++-- rs/execution_environment/src/metrics.rs | 2 +- .../src/scheduler/scheduler_metrics.rs | 4 ++-- .../tests/canister_history.rs | 2 +- rs/replicated_state/src/metadata_state.rs | 4 ++-- 23 files changed, 39 insertions(+), 39 deletions(-) diff --git a/rs/embedders/fuzz/fuzz_targets/compile_wasm_using_embedder.rs b/rs/embedders/fuzz/fuzz_targets/compile_wasm_using_embedder.rs index 99547bb3004..519cee9496e 100644 --- a/rs/embedders/fuzz/fuzz_targets/compile_wasm_using_embedder.rs +++ b/rs/embedders/fuzz/fuzz_targets/compile_wasm_using_embedder.rs @@ -12,7 +12,7 @@ use wasm_smith::{Config, Module}; // libfuzzer with a specific timeout, in Clusterfuzz this can be achieved using 'TEST_TIMEOUT' environment // string from the template. // -// Given that WASM binaries with a size of up to 30MB are expected for this feature, the payload size +// Given that Wasm binaries with a size of up to 30MB are expected for this feature, the payload size // (i.e., max_len parameter in libfuzzer) needs to be also adjusted. // // The fuzz test is only compiled but not executed by CI. diff --git a/rs/embedders/fuzz/fuzz_targets/ws2wasm.rs b/rs/embedders/fuzz/fuzz_targets/ws2wasm.rs index 7ff5ed5fdbc..c25b3d5fd32 100644 --- a/rs/embedders/fuzz/fuzz_targets/ws2wasm.rs +++ b/rs/embedders/fuzz/fuzz_targets/ws2wasm.rs @@ -54,7 +54,7 @@ fn main() -> io::Result<()> { let module = ::arbitrary_take_rest(unstrucutred) .expect("Unable to extract wasm from Unstructured data"); let mut wasm = module.module.to_bytes(); - println!("WASM extraction successful!"); + println!("Wasm extraction successful!"); let instrumentation = CommandLineArgs::parse().inst; if instrumentation { @@ -79,7 +79,7 @@ fn main() -> io::Result<()> { let wat = CommandLineArgs::parse().wat; let print = CommandLineArgs::parse().print; if wat || print { - let wat_string = print_bytes(wasm).expect("couldn't translate WASM to wat"); + let wat_string = print_bytes(wasm).expect("couldn't translate Wasm to wat"); if print { println!("{}", wat_string); @@ -112,7 +112,7 @@ fn main() -> io::Result<()> { let mut file = File::create(ws_path.clone())?; file.write_all(wasm.as_slice())?; - println!("WASM written to {}", ws_path.display()); + println!("Wasm written to {}", ws_path.display()); } Ok(()) } diff --git a/rs/embedders/src/wasm_utils/decoding.rs b/rs/embedders/src/wasm_utils/decoding.rs index f4810cd65e0..d9d5dd3ac73 100644 --- a/rs/embedders/src/wasm_utils/decoding.rs +++ b/rs/embedders/src/wasm_utils/decoding.rs @@ -57,7 +57,7 @@ fn wasm_encoding_and_size( )) } -/// Returns the expected size of the WASM that will result from decoding this module +/// Returns the expected size of the Wasm that will result from decoding this module /// (which may require uncompressing it). /// /// # Warning diff --git a/rs/embedders/src/wasm_utils/instrumentation.rs b/rs/embedders/src/wasm_utils/instrumentation.rs index e66522e8525..7d3b3be85e7 100644 --- a/rs/embedders/src/wasm_utils/instrumentation.rs +++ b/rs/embedders/src/wasm_utils/instrumentation.rs @@ -442,7 +442,7 @@ pub fn instruction_to_cost(i: &Operator) -> u64 { Operator::RefFunc { .. } => 130, //////////////////////////////////////////////////////////////// - // WASM SIMD Operators + // Wasm SIMD Operators Operator::V128Load { .. } => 1, Operator::V128Load8x8S { .. } => 1, Operator::V128Load8x8U { .. } => 1, diff --git a/rs/embedders/tests/misc_tests.rs b/rs/embedders/tests/misc_tests.rs index 92ae72aa1f4..275b6a39e7d 100644 --- a/rs/embedders/tests/misc_tests.rs +++ b/rs/embedders/tests/misc_tests.rs @@ -250,7 +250,7 @@ fn direct_export_of_import_without_unit_type() { #[test] fn nan_canonicalization_works() { - /// Returns a typed NaN generated by the provided WASM operator. + /// Returns a typed NaN generated by the provided Wasm operator. fn get_nan(canonicalize: bool, ty: &str, op: &str) -> T { let mut config = WasmtimeEmbedder::wasmtime_execution_config(&ic_config::embedders::Config::default()); diff --git a/rs/embedders/tests/wasmtime_embedder.rs b/rs/embedders/tests/wasmtime_embedder.rs index 0a520e5b921..c864f8813a3 100644 --- a/rs/embedders/tests/wasmtime_embedder.rs +++ b/rs/embedders/tests/wasmtime_embedder.rs @@ -1682,7 +1682,7 @@ fn wasm_logging_new_records_after_exceeding_log_size_limit() { .with_subnet_type(SubnetType::Application) .with_wat(&create_debug_print_wat(message_len)) .build(); - // Call the WASM method multiple times. + // Call the Wasm method multiple times. for i in 0..10 { let before = instance.instruction_counter(); instance diff --git a/rs/execution_environment/benches/management_canister/utils.rs b/rs/execution_environment/benches/management_canister/utils.rs index 96bdd7721f2..378671e3d07 100644 --- a/rs/execution_environment/benches/management_canister/utils.rs +++ b/rs/execution_environment/benches/management_canister/utils.rs @@ -10,7 +10,7 @@ use serde::Deserialize; pub const CANISTERS_PER_BATCH: u64 = 490; thread_local! { - // Store test canister WASM in a thread local memory to avoid re-reading the file for each bench. + // Store test canister Wasm in a thread local memory to avoid re-reading the file for each bench. static TEST_CANISTER_WASM: Vec = canister_test::Project::cargo_bin_maybe_from_env("test_canister", &[]).bytes(); } diff --git a/rs/execution_environment/benches/wasm_instructions/WASM_BENCHMARKS.md b/rs/execution_environment/benches/wasm_instructions/WASM_BENCHMARKS.md index e0f216c36b4..d3d524a970c 100644 --- a/rs/execution_environment/benches/wasm_instructions/WASM_BENCHMARKS.md +++ b/rs/execution_environment/benches/wasm_instructions/WASM_BENCHMARKS.md @@ -1,4 +1,4 @@ -WASM Instructions Benchmark Results +Wasm Instructions Benchmark Results =================================== This file is autogenerated by the `run_wasm_benchmarks.sh` diff --git a/rs/execution_environment/benches/wasm_instructions/WASM_COVERAGE.md b/rs/execution_environment/benches/wasm_instructions/WASM_COVERAGE.md index 3f8f903f801..3f1d0e880ad 100644 --- a/rs/execution_environment/benches/wasm_instructions/WASM_COVERAGE.md +++ b/rs/execution_environment/benches/wasm_instructions/WASM_COVERAGE.md @@ -1,4 +1,4 @@ -WASM Instructions Coverage +Wasm Instructions Coverage ========================== This file is autogenerated by the `wasm_coverage.sh` script. diff --git a/rs/execution_environment/benches/wasm_instructions/basic.rs b/rs/execution_environment/benches/wasm_instructions/basic.rs index 64c9bb94158..c1658fd3d9f 100644 --- a/rs/execution_environment/benches/wasm_instructions/basic.rs +++ b/rs/execution_environment/benches/wasm_instructions/basic.rs @@ -1,4 +1,4 @@ -//! Benchmarks for the basic WASM instructions. +//! Benchmarks for the basic Wasm instructions. //! //! References: //! * https://www.w3.org/TR/wasm-core-2/ diff --git a/rs/execution_environment/benches/wasm_instructions/main.rs b/rs/execution_environment/benches/wasm_instructions/main.rs index 50dcdef6c03..480fd563a90 100644 --- a/rs/execution_environment/benches/wasm_instructions/main.rs +++ b/rs/execution_environment/benches/wasm_instructions/main.rs @@ -1,5 +1,5 @@ //! -//! Benchmark WASM instructions using `execute_update()`. +//! Benchmark Wasm instructions using `execute_update()`. //! //! To run a specific benchmark: //! diff --git a/rs/execution_environment/benches/wasm_instructions/run_wasm_benchmarks.sh b/rs/execution_environment/benches/wasm_instructions/run_wasm_benchmarks.sh index f08432cdd45..4af5a14b0d2 100755 --- a/rs/execution_environment/benches/wasm_instructions/run_wasm_benchmarks.sh +++ b/rs/execution_environment/benches/wasm_instructions/run_wasm_benchmarks.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Runs the WASM instructions benchmarks, confirms the results are not optimized -# by the `wasmtime` compiler, and produces a WASM instructions costs report +# Runs the Wasm instructions benchmarks, confirms the results are not optimized +# by the `wasmtime` compiler, and produces a Wasm instructions costs report # in Markdown format (see `WASM_BENCHMARKS.md`). # # Usage: run_wasm_benchmarks.sh [-f] diff --git a/rs/execution_environment/benches/wasm_instructions/run_wasm_benchmarks_forever.sh b/rs/execution_environment/benches/wasm_instructions/run_wasm_benchmarks_forever.sh index e53ba499f7a..5bcba94544b 100755 --- a/rs/execution_environment/benches/wasm_instructions/run_wasm_benchmarks_forever.sh +++ b/rs/execution_environment/benches/wasm_instructions/run_wasm_benchmarks_forever.sh @@ -1,7 +1,7 @@ #!/bin/sh -e # Continuously improve `run_wasm_benchmarks_forever.md` file by running # the `run_wasm_benchmarks.sh` and taking the minimum results. The produced -# file is a much more precise WASM instructions costs report in Markdown format +# file is a much more precise Wasm instructions costs report in Markdown format # (see `WASM_BENCHMARKS.md`). # # Usage: run_wasm_benchmarks_forever.sh diff --git a/rs/execution_environment/benches/wasm_instructions/simd.rs b/rs/execution_environment/benches/wasm_instructions/simd.rs index a38df505808..d702043a47a 100644 --- a/rs/execution_environment/benches/wasm_instructions/simd.rs +++ b/rs/execution_environment/benches/wasm_instructions/simd.rs @@ -1,4 +1,4 @@ -//! Benchmarks for the SIMD WASM instructions. +//! Benchmarks for the Wasm SIMD instructions. //! //! References: //! * https://www.w3.org/TR/wasm-core-2/ diff --git a/rs/execution_environment/benches/wasm_instructions/wasm_coverage.sh b/rs/execution_environment/benches/wasm_instructions/wasm_coverage.sh index fe8224b5812..deaefdb203a 100755 --- a/rs/execution_environment/benches/wasm_instructions/wasm_coverage.sh +++ b/rs/execution_environment/benches/wasm_instructions/wasm_coverage.sh @@ -1,21 +1,21 @@ #!/bin/sh -# Uses the list of `wasmparser` supported WASM proposals, WASM instructions -# benchmarks and WASM instructions costs defined in the `ic` repo to produce -# a WASM instructions coverage report in Markdown format (see `WASM_COVERAGE.md`) +# Uses the list of `wasmparser` supported Wasm proposals, Wasm instructions +# benchmarks and Wasm instructions costs defined in the `ic` repo to produce +# a Wasm instructions coverage report in Markdown format (see `WASM_COVERAGE.md`) # # Usage: wasm_coverage.sh -# The file with basic WASM instruction benchmarks. +# The file with basic Wasm instruction benchmarks. BASIC_BENCHES_FILE="${0%/*}/../wasm_instructions/basic.rs" -# The file with SIMD WASM instruction benchmarks. +# The file with Wasm SIMD instruction benchmarks. SIMD_BENCHES_FILE="${0%/*}/../wasm_instructions/simd.rs" # The file with `instruction_to_cost` function. INSTRUCTION_TO_COST_FILE="${0%/*}/../../../embedders/src/wasm_utils/instrumentation.rs" -# The file with WASM proposal to WAS operator mapping. +# The file with Wasm proposal to Wasm operator mapping. PROPOSAL_TO_OP_URL="https://raw.githubusercontent.com/bytecodealliance/wasm-tools/main/crates/wasmparser/src/lib.rs" -# The file with WASM operator to WASM instruction mapping. +# The file with Wasm operator to Wasm instruction mapping. OP_TO_INSTR_URL="https://raw.githubusercontent.com/bytecodealliance/wasm-tools/main/crates/wast/src/core/expr.rs" -# The WASM proposal to exclude from the coverage, i.e. unsupported WASM proposals. +# The Wasm proposal to exclude from the coverage, i.e. unsupported Wasm proposals. EXCLUDE_PROPOSALS="tail_call|relaxed_simd|threads|multi_memory|exceptions|memory64|extended_const|component_model|function_references|memory_control|gc|shared_everything_threads" # Extract `instruction_to_cost` function from the file. diff --git a/rs/execution_environment/src/canister_manager/tests.rs b/rs/execution_environment/src/canister_manager/tests.rs index 8fd8e5e8ba2..f815c282aa4 100644 --- a/rs/execution_environment/src/canister_manager/tests.rs +++ b/rs/execution_environment/src/canister_manager/tests.rs @@ -87,7 +87,7 @@ const MEMORY_CAPACITY: NumBytes = NumBytes::new(8 * 1024 * 1024 * 1024); // 8GiB const MAX_CONTROLLERS: usize = 10; const WASM_PAGE_SIZE_IN_BYTES: u64 = 64 * 1024; // 64KiB const MAX_NUMBER_OF_CANISTERS: u64 = 0; -// The simplest valid WASM binary: "(module)" +// The simplest valid Wasm binary: "(module)" const MINIMAL_WASM: [u8; 8] = [ 0, 97, 115, 109, // \0ASM - magic 1, 0, 0, 0, // 0x01 - version diff --git a/rs/execution_environment/src/execution/upgrade/tests.rs b/rs/execution_environment/src/execution/upgrade/tests.rs index 878d7a50401..a544a31814e 100644 --- a/rs/execution_environment/src/execution/upgrade/tests.rs +++ b/rs/execution_environment/src/execution/upgrade/tests.rs @@ -171,7 +171,7 @@ fn func(function: Function, execution: Execution) -> String { } } -/// Returns a new WASM binary for a specified slice of functions. +/// Returns a new Wasm binary for a specified slice of functions. fn binary(functions: &[(Function, Execution)]) -> Vec { let wat = module( functions @@ -183,12 +183,12 @@ fn binary(functions: &[(Function, Execution)]) -> Vec { wat::parse_str(wat).unwrap() } -/// Returns an old empty WASM binary. +/// Returns an old empty Wasm binary. fn old_empty_binary() -> Vec { wat::parse_str(module("")).unwrap() } -/// Returns a new empty WASM binary. +/// Returns a new empty Wasm binary. fn new_empty_binary() -> Vec { wat::parse_str(module(r#"(func (export "new"))"#)).unwrap() } diff --git a/rs/execution_environment/src/execution_environment/tests/compilation.rs b/rs/execution_environment/src/execution_environment/tests/compilation.rs index c8c1b0034c2..a67fd47245e 100644 --- a/rs/execution_environment/src/execution_environment/tests/compilation.rs +++ b/rs/execution_environment/src/execution_environment/tests/compilation.rs @@ -557,7 +557,7 @@ mod state_machine_tests { expected_compilation_instructions.get() as f64, ); - // Installing another canister with the same WASM doesn't take instructions. + // Installing another canister with the same Wasm doesn't take instructions. let _canister_id2 = env.install_canister_wat(TEST_CANISTER, vec![], None); assert_eq!( env.subnet_message_instructions(), @@ -583,7 +583,7 @@ mod state_machine_tests { expected_compilation_instructions, ); - // Installing another canister with the same WASM uses instructions because + // Installing another canister with the same Wasm uses instructions because // there was a checkpoint since the last install. let _canister_id2 = env.install_canister_wat(TEST_CANISTER, vec![], None); assert_eq!( diff --git a/rs/execution_environment/src/history.rs b/rs/execution_environment/src/history.rs index 966b6933005..b85e7380328 100644 --- a/rs/execution_environment/src/history.rs +++ b/rs/execution_environment/src/history.rs @@ -258,7 +258,7 @@ fn dashboard_label_value_from(code: ErrorCode) -> &'static str { CanisterTrapped => "Canister Trapped", CanisterCalledTrap => "Canister Called Trap", CanisterContractViolation => "Canister Contract Violation", - CanisterInvalidWasm => "Canister Invalid WASM", + CanisterInvalidWasm => "Canister Invalid Wasm", CanisterDidNotReply => "Canister Did Not Reply", CanisterOutOfMemory => "Canister Out Of Memory", CanisterStopped => "Canister Stopped", @@ -305,7 +305,7 @@ fn dashboard_label_value_from(code: ErrorCode) -> &'static str { "Canister does not have enough cycles to grow message memory" } CanisterMethodNotFound => "Canister Method Not Found", - CanisterWasmModuleNotFound => "Canister WASM Module Not Found", + CanisterWasmModuleNotFound => "Canister Wasm Module Not Found", CanisterAlreadyInstalled => "Canister Already Installed", CanisterWasmMemoryLimitExceeded => "Canister exceeded its Wasm memory limit", } diff --git a/rs/execution_environment/src/metrics.rs b/rs/execution_environment/src/metrics.rs index c4251ccb1a0..b008526b798 100644 --- a/rs/execution_environment/src/metrics.rs +++ b/rs/execution_environment/src/metrics.rs @@ -444,7 +444,7 @@ pub fn cycles_histogram>( metrics_registry.histogram(name, help, decimal_buckets_with_zero(6, 15)) } -/// Returns buckets appropriate for WASM and Stable memories +/// Returns buckets appropriate for Wasm and Stable memories fn memory_buckets() -> Vec { const K: u64 = 1024; const M: u64 = K * 1024; diff --git a/rs/execution_environment/src/scheduler/scheduler_metrics.rs b/rs/execution_environment/src/scheduler/scheduler_metrics.rs index cdf014c7ac8..4da665a6c06 100644 --- a/rs/execution_environment/src/scheduler/scheduler_metrics.rs +++ b/rs/execution_environment/src/scheduler/scheduler_metrics.rs @@ -141,7 +141,7 @@ impl SchedulerMetrics { ), canister_binary_size: memory_histogram( "canister_binary_size_bytes", - "Canisters WASM binary size distribution in bytes.", + "Canisters Wasm binary size distribution in bytes.", metrics_registry, ), canister_log_memory_usage: memory_histogram( @@ -151,7 +151,7 @@ impl SchedulerMetrics { ), canister_wasm_memory_usage: memory_histogram( "canister_wasm_memory_usage_bytes", - "Canisters WASM memory usage distribution in bytes.", + "Canisters Wasm memory usage distribution in bytes.", metrics_registry, ), canister_stable_memory_usage: memory_histogram( diff --git a/rs/execution_environment/tests/canister_history.rs b/rs/execution_environment/tests/canister_history.rs index d40f2ada1e0..3d6098a2710 100644 --- a/rs/execution_environment/tests/canister_history.rs +++ b/rs/execution_environment/tests/canister_history.rs @@ -77,7 +77,7 @@ fn get_canister_info( } } -/// returns a StateMachine, the test canister WASM, and its module hash +/// Returns a StateMachine, the test canister Wasm, and its module hash. fn test_setup( subnet_type: SubnetType, now: std::time::SystemTime, diff --git a/rs/replicated_state/src/metadata_state.rs b/rs/replicated_state/src/metadata_state.rs index 1c775e0c834..f09aae6cd06 100644 --- a/rs/replicated_state/src/metadata_state.rs +++ b/rs/replicated_state/src/metadata_state.rs @@ -148,12 +148,12 @@ pub struct SystemMetadata { pub subnet_metrics: SubnetMetrics, - /// The set of WASM modules we expect to be present in the [`Hypervisor`]'s + /// The set of Wasm modules we expect to be present in the [`Hypervisor`]'s /// compilation cache. This allows us to deterministically decide when we /// expect a compilation to be fast and ignore the compilation cost when /// considering the round instruction limit. /// - /// Each time a canister is installed, its WASM is inserted and the set is + /// Each time a canister is installed, its Wasm is inserted and the set is /// cleared at each checkpoint. pub expected_compiled_wasms: BTreeSet,