Skip to content

Commit

Permalink
chore: fix capitalization of "Wasm"
Browse files Browse the repository at this point in the history
  • Loading branch information
ulan committed May 15, 2024
1 parent 2437aa3 commit 75f1c8f
Show file tree
Hide file tree
Showing 23 changed files with 39 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions rs/embedders/fuzz/fuzz_targets/ws2wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn main() -> io::Result<()> {
let module = <ICWasmModule as Arbitrary>::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 {
Expand All @@ -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);
Expand Down Expand Up @@ -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(())
}
2 changes: 1 addition & 1 deletion rs/embedders/src/wasm_utils/decoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rs/embedders/src/wasm_utils/instrumentation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion rs/embedders/tests/misc_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T: wasmtime::WasmTy>(canonicalize: bool, ty: &str, op: &str) -> T {
let mut config =
WasmtimeEmbedder::wasmtime_execution_config(&ic_config::embedders::Config::default());
Expand Down
2 changes: 1 addition & 1 deletion rs/embedders/tests/wasmtime_embedder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8> = canister_test::Project::cargo_bin_maybe_from_env("test_canister", &[]).bytes();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
WASM Instructions Benchmark Results
Wasm Instructions Benchmark Results
===================================

This file is autogenerated by the `run_wasm_benchmarks.sh`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
WASM Instructions Coverage
Wasm Instructions Coverage
==========================

This file is autogenerated by the `wasm_coverage.sh` script.
Expand Down
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
2 changes: 1 addition & 1 deletion rs/execution_environment/benches/wasm_instructions/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//!
//! Benchmark WASM instructions using `execute_update()`.
//! Benchmark Wasm instructions using `execute_update()`.
//!
//! To run a specific benchmark:
//!
Expand Down
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion rs/execution_environment/benches/wasm_instructions/simd.rs
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion rs/execution_environment/src/canister_manager/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions rs/execution_environment/src/execution/upgrade/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8> {
let wat = module(
functions
Expand All @@ -183,12 +183,12 @@ fn binary(functions: &[(Function, Execution)]) -> Vec<u8> {
wat::parse_str(wat).unwrap()
}

/// Returns an old empty WASM binary.
/// Returns an old empty Wasm binary.
fn old_empty_binary() -> Vec<u8> {
wat::parse_str(module("")).unwrap()
}

/// Returns a new empty WASM binary.
/// Returns a new empty Wasm binary.
fn new_empty_binary() -> Vec<u8> {
wat::parse_str(module(r#"(func (export "new"))"#)).unwrap()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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!(
Expand Down
4 changes: 2 additions & 2 deletions rs/execution_environment/src/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
}
Expand Down
2 changes: 1 addition & 1 deletion rs/execution_environment/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ pub fn cycles_histogram<S: Into<String>>(
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<f64> {
const K: u64 = 1024;
const M: u64 = K * 1024;
Expand Down
4 changes: 2 additions & 2 deletions rs/execution_environment/src/scheduler/scheduler_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion rs/execution_environment/tests/canister_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions rs/replicated_state/src/metadata_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<WasmHash>,

Expand Down

0 comments on commit 75f1c8f

Please sign in to comment.