← Back to Distributed Compute Exchange
EZC v1 — Safe Compute Block Language
Task authors on ezmon-e.com cannot upload raw C code, binaries, or shell scripts. Instead, distributed computing tasks are assembled strictly from authorized EZC v1 building blocks—like Lego parts that can be combined freely for mathematical, scientific, linear-algebra, signal-processing, and search workloads, yet can never open files, open network sockets, launch processes, read raw memory pointers, or run unbounded infinite loops.
Why EZC v1 Cannot Escape the Appliance
- Strict Allowlisted Grammar: Every statement is parsed into a typed syntax tree. Any unrecognized operation, malformed identifier, or arbitrary C syntax is rejected before compilation.
- Zero Pointers, Zero Dynamic Allocation, Zero System Calls: Buffers have fixed declared sizes checked at compile time, all math operations clamp or guard division by zero and out-of-range inputs, and the generated C code contains no filesystem, network, or process calls.
- Guaranteed Termination: Only fixed-count
REPEAT N ... ENDloops (maximum nesting depth 2, strict total operation ceiling per chunk) are allowed—nowhile,goto, or recursion. - Deterministic Verification: Every chunk runs deterministically from its assigned work-chunk seed, allowing ezmon-e.com to verify submitted answers mathematically and detect tampered clients.
Authorized EZC v1 Compute Blocks
| Block Syntax | Purpose | Safety Bounds |
|---|---|---|
VEC name len | Declare fixed zeroed float64 vector | 1 to 262,144 elements |
MAT name rows cols | Declare fixed zeroed float64 matrix | Up to 512×512 (262,144 max) |
SCALAR name [val] | Declare finite float64 scalar | Finite range [-1e12, 1e12] |
LOAD_CHUNK buf | Fill buffer deterministically from assigned work chunk seed | Zero filesystem or network access |
FILL var const | Fill scalar or buffer with finite constant | Finite float64 only |
MAP dst src op [arg] | Elementwise math (ADD_CONST, MUL_CONST, ABS, SQRT_SAFE, EXP_CLAMP, LOG_SAFE, SIN, COS, TANH, RELU, SIGMOID, SQUARE, CLAMP01) | Matching lengths verified at compile time |
ZIP dst a b op | Elementwise binary math (ADD, SUB, MUL, DIV_SAFE, MIN, MAX) | Division-by-zero guarded |
MATMUL dst a b | Dense matrix multiplication (CPU/GPU parallel) | Exact matrix dimensions verified |
CONV1D dst src kern | 1D finite-impulse signal convolution | Kernel length up to 65; zero-padded edges |
FFT re im | In-place radix-2 Fast Fourier Transform | Power-of-2 length up to 65,536 |
REDUCE out src op | Deterministic reduction (SUM, MEAN, MIN, MAX, L2_NORM) | Scalar output only |
MONTE_CARLO out N mode | Deterministic simulation (PI_CIRCLE, GAUSS_INTEGRAL, BLACK_SCHOLES_CALL, ISING_ENERGY) | 1 to 2,000,000 samples per chunk |
PRIME_SIEVE out win | Segmented prime counting over chunk integer range | Window 100 to 2,000,000 integers |
HASH_SCAN out bits iters | Bounded SHA-256 prefix nonce search | 1–24 leading bits, up to 500,000 iters |
SORT vec | Deterministic non-recursive in-place heapsort | Guaranteed O(N log N) time, O(1) stack |
REPEAT N ... END | Strictly bounded fixed-iteration loop | Max 1,000 iters, max nesting depth 2 |
EMIT var | Emit verified chunk output hash back to ezmon-e.com | Required at least once per task |
Example Distributed Workloads
Distributed Segmented Prime Number Search (Number Theory)
Counts prime numbers across consecutive 250,000-integer windows using a deterministic segmented sieve, suitable for CPU-heavy volunteer or paid number-theory projects.
# Segmented prime search across 250,000 integers per chunk
SCALAR primes_found 0
PRIME_SIEVE primes_found 250000
EMIT primes_found
Monte Carlo Pi & Black-Scholes Stochastic Integration (Scientific Simulation)
Runs 500,000 deterministic xoshiro256** Monte Carlo samples per chunk for geometric Pi estimation and stochastic option-pricing integrals.
# Stochastic Monte Carlo simulation (500k samples per chunk)
SCALAR pi_est 0
SCALAR option_val 0
MONTE_CARLO pi_est 500000 PI_CIRCLE
MONTE_CARLO option_val 250000 BLACK_SCHOLES_CALL
EMIT pi_est
EMIT option_val
Signal Denoising & 4096-Point Spectrum FFT (Signal Processing / Astronomy)
Applies a 5-tap 1D convolution smoothing kernel followed by a 4096-point radix-2 Fast Fourier Transform to measure spectral energy across time-series windows.
# 4096-sample signal filter + radix-2 FFT spectral analysis
VEC raw_sig 4096
VEC filtered 4096
VEC imag 4096
VEC kernel 5
SCALAR peak_energy 0
LOAD_CHUNK raw_sig
FILL kernel 0.2
CONV1D filtered raw_sig kernel
FILL imag 0
FFT filtered imag
MAP filtered filtered SQUARE
MAP imag imag SQUARE
ZIP filtered filtered imag ADD
REDUCE peak_energy filtered MAX
EMIT peak_energy
Dense 128×128 Matrix & Neural ReLU Layer Micro-Batch (Linear Algebra / ML)
Computes dense 128×128 matrix multiplication with ReLU activation and L2 norm reduction (CPU multi-core and Vulkan GPU offload capable).
# Dense 128x128 matrix multiply + ReLU + L2 norm
MAT weights 128 128
MAT inputs 128 128
MAT hidden 128 128
SCALAR norm_out 0
LOAD_CHUNK weights
LOAD_CHUNK inputs
MATMUL hidden weights inputs
MAP hidden hidden RELU
REDUCE norm_out hidden L2_NORM
EMIT norm_out
Distributed SHA-256 Prefix Nonce Scan (Cryptographic Research)
Searches partitioned 100,000-nonce ranges per chunk for SHA-256 digests with 16 leading zero bits, returning the first matching nonce or -1.
# Bounded SHA-256 prefix search (16 leading zero bits)
SCALAR match_nonce -1
HASH_SCAN match_nonce 16 100000
EMIT match_nonce
Public Runtime Header (ezc_runtime.h)
Every compiled EZC v1 task includes ezc_runtime.h, which declares the exact operation constants and function signatures available to compiled task code.
You can inspect it below or open the raw header directly at /compute/runtime/ezc_runtime.h.
View ezc_runtime.h (SHA-256: eac06d7ca873dcace5bd54cdb5114c92385740b525f4aee68e7eb11d19ca4da0)
#ifndef EZC_RUNTIME_H
#define EZC_RUNTIME_H
#include <stdint.h>
#include <stddef.h>
enum {
EZC_MAP_ADD_CONST = 1,
EZC_MAP_MUL_CONST = 2,
EZC_MAP_ABS = 3,
EZC_MAP_SQRT_SAFE = 4,
EZC_MAP_EXP_CLAMP = 5,
EZC_MAP_LOG_SAFE = 6,
EZC_MAP_SIN = 7,
EZC_MAP_COS = 8,
EZC_MAP_TANH = 9,
EZC_MAP_RELU = 10,
EZC_MAP_SIGMOID = 11,
EZC_MAP_SQUARE = 12,
EZC_MAP_CLAMP01 = 13
};
enum {
EZC_ZIP_ADD = 1,
EZC_ZIP_SUB = 2,
EZC_ZIP_MUL = 3,
EZC_ZIP_DIV_SAFE = 4,
EZC_ZIP_MIN = 5,
EZC_ZIP_MAX = 6
};
enum {
EZC_RED_SUM = 1,
EZC_RED_MEAN = 2,
EZC_RED_MIN = 3,
EZC_RED_MAX = 4,
EZC_RED_L2_NORM = 5
};
enum {
EZC_MC_PI_CIRCLE = 1,
EZC_MC_GAUSS_INTEGRAL = 2,
EZC_MC_BLACK_SCHOLES_CALL = 3,
EZC_MC_ISING_ENERGY = 4
};
typedef struct {
uint32_t state[8];
uint64_t bitlen;
uint8_t data[64];
size_t datalen;
} ezc_sha256_ctx;
typedef struct {
ezc_sha256_ctx sha;
int emitted_count;
double last_summary;
} ezc_emit_ctx;
void ezc_zero(double *dst, int n);
void ezc_fill(double *dst, int n, double val);
void ezc_load_chunk(double *dst, int n, uint64_t task_seed, uint64_t chunk_index, uint32_t salt);
void ezc_map(double *dst, const double *src, int n, int op, double arg);
void ezc_zip(double *dst, const double *a, const double *b, int n, int op);
void ezc_matmul(double *dst, const double *a, const double *b, int m, int k, int n);
void ezc_conv1d(double *dst, const double *src, int n, const double *kern, int kl);
void ezc_fft_radix2(double *re, double *im, int n);
double ezc_reduce(const double *src, int n, int op);
double ezc_monte_carlo(uint64_t task_seed, uint64_t chunk_index, uint32_t salt, int samples, int mode);
int64_t ezc_prime_sieve(uint64_t chunk_index, uint32_t window);
int64_t ezc_hash_scan(uint64_t task_seed, uint64_t chunk_index, uint32_t leading_bits, uint32_t max_iters);
void ezc_heapsort(double *a, int n);
void ezc_emit_scalar(ezc_emit_ctx *ctx, double val);
void ezc_emit_buffer(ezc_emit_ctx *ctx, const double *buf, int n);
/* Generated strictly by ezmon-e EZC v1 compiler (task_kernel.c) */
int ezc_run_chunk(uint64_t task_seed, uint64_t chunk_index, ezc_emit_ctx *emit);
#endif /* EZC_RUNTIME_H */