ParetoStackpareto-stackdocshpc-labs

Examples

The example projects that come with ParetoStack 0.4.5. paretostack examples lists them; paretostack examples run NAME --yes copies one to ~/ParetoStack/sample/NAME and optimizes it.

Example Output Needs Strategy
word_filter bit-exact Python only L2 set membership
text_stats bit-exact Python only L1 bind (little to gain)
quickstart bit-exact Python only L1 inline / bind
vector_loops bit-exact numpy L1 vectorize
parallel_items bit-exact numpy L1 parallelize
assert_heavy bit-exact Python only L0 python -O (search)
matmul_lib contract numpy LIB library swap
image_fixed_point contract numpy L3 fixed point (accuracy trade)
fft_convolution contract numpy L3 FFT convolution
box_sums contract numpy L3 summed-area table (NumPy)
opencv_filters contract OpenCV 5 L3 summed-area table (OpenCV)
opencv_pixels bit-exact OpenCV OpenCV: pixel loops -> cv2 functions
opencv_cse bit-exact OpenCV OpenCV: repeated work done once
opencv_metrics bit-exact OpenCV OpenCV: SAD / SSD / histogram loops
opencv_color contract OpenCV OpenCV: grey / blend (rounding differs)
nbody_sim contract a C compiler L4 C port
s3_ocr_rescan bit-exact Python only Cloud-style job: fake S3 bucket + OCR (L1 / PAR)
lambda_log_digest bit-exact Python only AWS Lambda function, offline harness (L1 / L2; cloud lambda-optimize --zip)
gcf_log_digest bit-exact Python only Google Cloud Function, offline harness (L1 / L2; cloud gcf-optimize --zip)
cpp_matmul bit-exact a C++ compiler C++ L2 tiled matrix multiply
cpp_loops bit-exact a C++ compiler C++ L2 interchange + OpenMP
java_box_sums contract a JDK Java L3 summed-area table
py_workloads bit-exact Python only The CPython study's 13 pure-Python workloads (L1 inline / bind, L2 membership)
lambda_py_workloads bit-exact Python only AWS Lambda compute worker, offline harness (L1; cloud lambda-optimize --zip --port, lambda-tune)
gcf_py_workloads bit-exact Python only Google Cloud Function compute worker, offline harness (L1; cloud gcf-optimize --zip, gcf-tune)
lambda_db_orders bit-exact Python only AWS Lambda order enrichment, offline harness: a query per order -> one batched query (DB; cloud lambda-optimize --zip)
log_report bit-exact Python only L1 text rules: regex compiled once + a string grown on an attribute joined once (str_build, re_hoist)

word_filter

Word filter demo (list membership in a loop)

text_stats

Text statistics demo (pure Python string processing)

quickstart

Quick start (a small project that passes steps 1 to 5)

vector_loops

vector_loops (strategy sample)

parallel_items

parallel_items (strategy sample)

assert_heavy

assert_heavy (strategy sample)

matmul_lib

Matrix-multiply demo (library swap to NumPy / BLAS)

image_fixed_point

Fixed-point image maths (NOT bit-exact): grey, blend and contrast on 1080p frames

fft_convolution

FIR filter by direct convolution (NOT bit-exact): the FFT version rounds differently

box_sums

Window sums by slicing (NOT bit-exact): a summed-area table does it in four additions

opencv_filters

OpenCV filters demo (separable filter2D + local window means)

opencv_pixels

OpenCV demo: hand-written pixel loops (threshold, difference, blur, Sobel, erode, dilate, flip, histogram, sums)

opencv_cse

OpenCV demo: the same work repeated on the same image (grey, bilateral, median, Canny, template match)

opencv_metrics

OpenCV demo: SAD / SSD / energy / histogram / extremes written as loops

opencv_color

OpenCV demo (NOT bit-exact): grey conversion and blending loops, judged by PSNR / SSIM

nbody_sim

N-body gravity simulation demo (physics, NumPy arrays with scalar loops)

s3_ocr_rescan

Re-scan and OCR documents kept in S3 (a made-up project: fake bucket, no network)

lambda_log_digest

An AWS Lambda function, offline: an SQS log digest run on recorded events by a local harness

gcf_log_digest

A Google Cloud Function, offline: a web access-log report run on recorded requests by a local harness

cpp_matmul

C++ matrix multiply: loop order and tiling (bit-exact)

cpp_loops

C++ loops: interchange and OpenMP (bit-exact)

java_box_sums

Java window sums: summed-area table (NOT bit-exact)

py_workloads

The CPython study's 13 pure-Python workloads as one program (bit-exact)

lambda_py_workloads

An AWS Lambda compute worker, offline: the CPython study's workloads, one per invocation

gcf_py_workloads

A Google Cloud Function compute worker, offline: the CPython study's workloads, one per request

lambda_db_orders

An AWS Lambda order-enrichment function, offline: one query per order (the N+1 pattern) and a customer report added up in Python, on a SQLite fixture

log_report

A log report: lines parsed with re.match in a loop, the report text grown on an attribute (str_build + re_hoist, 0.3.12)

The sample picker

There are many samples, so a menu picks one: first which sample, then how (a preset with a set of options). The exact command line is shown and runs after you say yes.

paretostack examples pick                          the menu
paretostack examples pick NAME PRESET              straight to one
paretostack examples pick --product cloud          only the cloud samples

example.sh or example.cmd with no argument open the same menu (all still runs the tour), and the assistant has /examples pick. The product shown follows the package you installed.

Software

samples presets
10 core: word_filter, text_stats, quickstart, vector_loops, parallel_items, assert_heavy, matmul_lib, image_fixed_point, fft_convolution, box_sums quick run --yes --fast
17 extra: opencv_filters, opencv_pixels, opencv_cse, opencv_metrics, opencv_color, nbody_sim, cpp_matmul, cpp_loops, java_box_sums, s3_ocr_rescan, lambda_log_digest, gcf_log_digest, py_workloads, lambda_py_workloads, gcf_py_workloads, lambda_db_orders, log_report exact run --yes
search search --yes --fast --budget 12
local-ai run --yes --ai local · cloud-ai run --yes --ai claude

Cloud (version line 0.4)

The software samples and presets, plus:

samples presets
lambda_log_digest, lambda_py_workloads and lambda_db_orders (AWS Lambda), gcf_log_digest and gcf_py_workloads (Google Cloud Function), s3_ocr_rescan (S3 job: check only) cloud-check cloud check
cloud-offline cloud lambda-optimize --zip PKG --events E --handler lambda_function.handler · cloud gcf-optimize --zip PKG --events E --entry-point digest_http (the package and events are written under the sample's cloud/ folder)
cloud-offline-port the Lambda ones with --port (lambda_py_workloads: n-body, spectral norm and float maths are the kernels the C port targets)
cloud-plan cloud lambda-tune / gcf-tune --events E --function NAME [--project P --region R] (asked for)
cloud-sandbox the same with --run --sandbox --max-cost 1

Chip (version line 0.5: in development, not part of 0.4.3)

The hardware and circuit-board samples appear only in builds of the 0.5 line.

samples presets
hw_fir, hw_alu8, hw_alu_sv, hw_mul16, hw_dot4, hw_crc32, hw_mac_vhdl (Verilog / SystemVerilog / VHDL for an FPGA) hw-analyze hw analyze P · hw-quick hw run P --seeds 5 --rewrites none · hw-full hw run P --seeds 8
pcb_blinker, pcb_bus (KiCad boards) pcb-analyze pcb analyze BOARD · pcb-route pcb route BOARD