← All Distributed Computing Projects
Monte Carlo Pi & Black-Scholes Stochastic Integration
Task tsk_0002_monte_carlo_pi · Published by @ezmone ·
Category: Scientific Simulation ·
Status: OPEN
Runs 500,000 deterministic xoshiro256** Monte Carlo samples per chunk for geometric Pi estimation and stochastic option-pricing integrals.
f9f1f0b0447fb25f09c169182b3dc549b0b01aa4ddb75bb0a7c6acd2b1ab1897
Bound into every appliance built for this task.
Full Task Code Audit (Inspect Everything Before Accepting)
Before downloading any appliance, inspect the exact EZC v1 safe compute blocks written by @ezmone, our plain-English step-by-step summary, and the exact C source code compiled into the appliance. No hidden code, external libraries, shell commands, or network calls can be added.
Step-by-Step Plain-English Audit (6 verified operations)
- Declare float64 scalar pi_est = 0
- Declare float64 scalar option_val = 0
- Run 500000 deterministic Monte Carlo samples (PI_CIRCLE) into scalar pi_est
- Run 250000 deterministic Monte Carlo samples (BLACK_SCHOLES_CALL) into scalar option_val
- Emit verified deterministic result for pi_est (SCALAR) back to ezmon-e
- Emit verified deterministic result for option_val (SCALAR) back to ezmon-e
Exact EZC v1 Safe Block Source Code
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
Exact Compiled ANSI C99 Code (SHA-256: 6a00b942f052874d2c17e782b7bdcaa457382e5cb1a1c8360e90f40362fb3a45)
/* Auto-generated by ezmon-e EZC v1 Safe Compute Compiler.
* Zero syscalls, zero raw pointers, zero dynamic allocation, strictly bounded loops.
* Source SHA-256: f9f1f0b0447fb25f09c169182b3dc549b0b01aa4ddb75bb0a7c6acd2b1ab1897
*/
#include "ezc_runtime.h"
static double ezv_pi_est = 0;
static double ezv_option_val = 0;
int ezc_run_chunk(uint64_t task_seed, uint64_t chunk_index, ezc_emit_ctx *emit) {
ezv_pi_est = 0;
ezv_option_val = 0;
ezv_pi_est = ezc_monte_carlo(task_seed, chunk_index, 3U, 500000, EZC_MC_PI_CIRCLE);
ezv_option_val = ezc_monte_carlo(task_seed, chunk_index, 4U, 250000, EZC_MC_BLACK_SCHOLES_CALL);
ezc_emit_scalar(emit, ezv_pi_est);
ezc_emit_scalar(emit, ezv_option_val);
return 0;
}
Included Safe Compute Header: ezc_runtime.h (SHA-256: eac06d7ca873dcace5bd54cdb5114c92385740b525f4aee68e7eb11d19ca4da0)
This is the exact C header included by #include "ezc_runtime.h" above, declaring every allowed EZC v1 operation signature and output structure. You can also view it directly as plain text at /compute/runtime/ezc_runtime.h.
#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 */
Configure Resources & Build Your Personal Single-Task QEMU Appliance
Sign up free or log in so ezmon-e can build an appliance cryptographically bound to your @username and credit all verified compute sessions directly to your account.