Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
88b8e1c
Global sub-pixel image buffer first pass
ScepticalRabbit Aug 3, 2026
7bffe7a
Fixed bug in global stripe mode
ScepticalRabbit Aug 3, 2026
729b644
Fixed depth buffer threading bug in global path
ScepticalRabbit Aug 4, 2026
f37014b
Updated c-abi and python abi to have buffer_mode
ScepticalRabbit Aug 4, 2026
a763e73
Version number bump
ScepticalRabbit Aug 4, 2026
646896e
Fixed SIMD lane overlap write issue
ScepticalRabbit Aug 4, 2026
2c4fffc
Added threading to global scratch resolve
ScepticalRabbit Aug 4, 2026
5366583
Removed timing noise from reporting block
ScepticalRabbit Aug 4, 2026
d7a576e
Added mesh convention update to Riley to start enforcement
ScepticalRabbit Aug 21, 2026
cc56d72
Finished migration of safe mesh data to new convention maintaining te…
ScepticalRabbit Aug 21, 2026
1e684b8
Finished migration of min test suite to mesh convention
ScepticalRabbit Aug 21, 2026
207c96b
Fixed all mesh convention issues
ScepticalRabbit Aug 21, 2026
7663d99
Adding more general mesh convention tests.
ScepticalRabbit Aug 22, 2026
b3cb239
Added a mesh convention doc and moved design specs to dedicated folder
ScepticalRabbit Aug 23, 2026
aadb073
Renamed cyth directory to cython for consistency
ScepticalRabbit Aug 23, 2026
11e0a82
Moved enums into relevant files and made them follow naming and case …
ScepticalRabbit Aug 23, 2026
7c7d6fb
Added python style guide
ScepticalRabbit Aug 24, 2026
b9c631f
Added enums for camera psf and distortion models
ScepticalRabbit Aug 24, 2026
c3a4611
Refactoring mesh convention helpers to use consistent check and enfor…
ScepticalRabbit Aug 24, 2026
5c06a85
File restructuring of meshconv for clarity
ScepticalRabbit Aug 24, 2026
b46064e
Removed redundant re checking from enforce mesh convention function
ScepticalRabbit Aug 24, 2026
7f551b6
Tidying formatting in meshconv module
ScepticalRabbit Aug 24, 2026
c9b4274
Making doc strings consistent
ScepticalRabbit Aug 24, 2026
9b591da
Reviewed and updated mesh convention code for consistency, clarity an…
ScepticalRabbit Aug 24, 2026
1b16346
Updated examples to reduce number of frames
ScepticalRabbit Aug 24, 2026
e592139
Review, refactor and improvements to all python code
ScepticalRabbit Aug 24, 2026
2c04f65
Added to python style guide for function naming and abbreviations - i…
ScepticalRabbit Aug 25, 2026
6f36930
Removing massive comprehensions for clarity
ScepticalRabbit Aug 25, 2026
722d43e
Splitting deep if conditions for clarity
ScepticalRabbit Aug 25, 2026
d666fb7
Splitting expressions for clarity in meshconv.py
ScepticalRabbit Aug 25, 2026
e33b88f
Expanded test coverage for mesh convention
ScepticalRabbit Aug 25, 2026
b582e7f
Last pass refactor across python tools
ScepticalRabbit Aug 25, 2026
8b8de76
Merge remote-tracking branch 'origin/dev' into glob_im_buff
ScepticalRabbit Aug 25, 2026
13a25d9
Added data for mesh convention pytests as python package data
ScepticalRabbit Aug 25, 2026
7c2ecd1
Updated tests to run with 2 threads for CI limitations
ScepticalRabbit Aug 25, 2026
b3a426b
Removed multi-threading participation tests as they are difficult to …
ScepticalRabbit Aug 25, 2026
30cd0a8
Updated Riley demos to be stand alone and to remove quad4ibi for down…
ScepticalRabbit Aug 26, 2026
ac3e57b
Tidying up camera positioning helpers for use with pyvale render api
ScepticalRabbit Aug 28, 2026
39ae882
Numped version number because it will be sept by the time the PR merges
ScepticalRabbit Aug 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ refs/
# Keep the min test suite to ship with the repo
!data/min/
!data/min/**/*.csv
!data/cubes/
!data/cubes/**/*.csv
!gold/min/
!gold/min/**/*.fimg
!gold/min/**/*.bmp
Expand Down Expand Up @@ -97,8 +99,8 @@ uv.lock

# Cython
*.html
src/riley/cyth/riley.c
src/riley/cyth/riley.html
src/riley/cython/riley.c
src/riley/cython/riley.html

# Windows :(
*.dll
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include scripts/python_package_data.toml
recursive-include src/riley *.py *.pxd *.h *.zig

prune src/riley/__pycache__
prune src/riley/cyth/__pycache__
prune src/riley/cython/__pycache__
prune src/riley/zig/__pycache__
prune src/riley_raster.egg-info
prune src/riley.egg-info
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,13 @@ or with the build system:
zig build demo-<CASE> -Doptimize=ReleaseFast
```

where `CASE` is one of `sphere200`, `rabbits`, `dicuq`, or `stereocal`. Zig demo output is written to `./out/demo-CASE/`.
where `CASE` is one of `sphere200`, `psf`, `rabbits`, `dicuq`, or `stereocal`. Zig demo output is written to `./out/demo-CASE/`.
The `psf` demo writes separate `global_subpx_full` and `global_subpx_stripe` subdirectories.

Zig demo source on GitHub:

- [`demo_sphere200.zig`](https://github.com/Computer-Aided-Validation-Laboratory/riley-raster/blob/main/src/demo_sphere200.zig)
- [`demo_psf.zig`](https://github.com/Computer-Aided-Validation-Laboratory/riley-raster/blob/main/src/demo_psf.zig)
- [`demo_rabbits.zig`](https://github.com/Computer-Aided-Validation-Laboratory/riley-raster/blob/main/src/demo_rabbits.zig)
- [`demo_dicuq.zig`](https://github.com/Computer-Aided-Validation-Laboratory/riley-raster/blob/main/src/demo_dicuq.zig)
- [`demo_stereocal.zig`](https://github.com/Computer-Aided-Validation-Laboratory/riley-raster/blob/main/src/demo_stereocal.zig)
Expand All @@ -115,6 +117,7 @@ Python demo output is written to `Path.cwd() / "out-riley-py" / "demo-CASE"`.
Python demo source on GitHub:

- [`demo_sphere200.py`](https://github.com/Computer-Aided-Validation-Laboratory/riley-raster/blob/main/src/riley/pydemos/demo_sphere200.py)
- [`demo_psf.py`](https://github.com/Computer-Aided-Validation-Laboratory/riley-raster/blob/main/src/riley/pydemos/demo_psf.py)
- [`demo_rabbits.py`](https://github.com/Computer-Aided-Validation-Laboratory/riley-raster/blob/main/src/riley/pydemos/demo_rabbits.py)
- [`demo_dicuq.py`](https://github.com/Computer-Aided-Validation-Laboratory/riley-raster/blob/main/src/riley/pydemos/demo_dicuq.py)
- [`demo_dic_from_exodus.py`](https://github.com/Computer-Aided-Validation-Laboratory/riley-raster/blob/main/src/riley/pydemos/demo_dic_from_exodus.py)
Expand Down
11 changes: 8 additions & 3 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const std = @import("std");

const riley_version = std.SemanticVersion{
.major = 2026,
.minor = 7,
.patch = 1,
.minor = 9,
.patch = 0,
};

const RunEntry = struct {
Expand Down Expand Up @@ -52,7 +52,7 @@ pub fn build(b: *std.Build) void {
build_options_module,
);
shared_lib.installHeader(
b.path("src/riley/cyth/riley.h"),
b.path("src/riley/cython/riley.h"),
"riley.h",
);
b.installArtifact(shared_lib);
Expand Down Expand Up @@ -95,6 +95,11 @@ pub fn build(b: *std.Build) void {
.description = "Run the sphere200 demo",
.source_path = "src/demo_sphere200.zig",
},
.{
.step_name = "demo-psf",
.description = "Run the Gaussian PSF demo",
.source_path = "src/demo_psf.zig",
},
.{
.step_name = "demo-rabbits",
.description = "Run the rabbits demo",
Expand Down
2 changes: 1 addition & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.{
.name = .riley,
.version = "2026.7.1",
.version = "2026.9.0",
.fingerprint = 0x7380980579fcd8b7, // Changing this has security and trust implications.
.minimum_zig_version = "0.16.0",
.dependencies = .{
Expand Down
2 changes: 1 addition & 1 deletion data/FE/save_sim_to_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def main() -> None:
mesh_world.coords,
(2464, 2056),
uv_span_max=0.8,
projection_plane=(
proj_plane=(
np.array((0.0, 0.0, -1.0), dtype=np.float64),
np.array((0.0, 0.0, 0.0), dtype=np.float64),
),
Expand Down
96 changes: 96 additions & 0 deletions data/audit_mesh_convention.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#!/usr/bin/env python3
"""Report whether every CSV mesh below ``data`` follows Riley's convention."""

from __future__ import annotations

from pathlib import Path
import sys
import importlib.util

import numpy as np


DATA_DIR = Path(__file__).resolve().parent
CONNECT_FILENAMES = ("connect.csv", "connectivity.csv")


def _load_meshconv():
"""Load Riley's dependency-free convention module without its Cython API."""

module_path = DATA_DIR.parent / "src" / "riley" / "python" / "meshconv.py"
spec = importlib.util.spec_from_file_location("riley_meshconv", module_path)
if spec is None or spec.loader is None:
raise RuntimeError(f"Could not load mesh-convention module: {module_path}")
module = importlib.util.module_from_spec(spec)
sys.modules[spec.name] = module
spec.loader.exec_module(module)
return module


meshconv = _load_meshconv()


def main() -> int:
results = [audit_mesh(mesh_dir) for mesh_dir in find_mesh_dirs()]
width = max(len(mesh_name) for status, mesh_name, _ in results)

print("Riley mesh convention audit")
print()
for status, mesh_name, detail in results:
print(f"{status:<11} {mesh_name:<{width}} {detail}")

conforms = sum(status == "CONFORMS" for status, _, _ in results)
errors = len(results) - conforms
print()
print(f"Summary: {conforms} conform, {errors} do not ({len(results)} meshes total).")
return 1 if errors else 0


def find_mesh_dirs() -> list[Path]:
return sorted(
{
path.parent
for filename in CONNECT_FILENAMES
for path in DATA_DIR.rglob(filename)
if path.parent.joinpath("coords.csv").is_file()
},
)


def audit_mesh(mesh_dir: Path) -> tuple[str, str, str]:
mesh_name = mesh_dir.relative_to(DATA_DIR).as_posix()
try:
coords = np.loadtxt(mesh_dir / "coords.csv", delimiter=",", dtype=np.float64)
connect_paths = [mesh_dir / name for name in CONNECT_FILENAMES]
connect_paths = [path for path in connect_paths if path.is_file()]
connect_tables = [np.loadtxt(path, delimiter=",", dtype=np.int64) for path in connect_paths]
if len(connect_tables) == 2 and not np.array_equal(*connect_tables):
raise ValueError("connect.csv and connectivity.csv differ")

mesh = meshconv.SimData(
coords=np.atleast_2d(coords),
connect={"connect1": np.atleast_2d(connect_tables[0])},
mesh_type=_mesh_type_hint(mesh_dir),
)
report = meshconv.check_mesh_convention(mesh)
except (OSError, ValueError, NotImplementedError) as err:
return "DOES NOT", mesh_name, str(err)

if report.is_valid:
return "CONFORMS", mesh_name, ""
return "DOES NOT", mesh_name, ", ".join(report.failed_checks)


def _mesh_type_hint(mesh_dir: Path) -> meshconv.EMeshType | None:
if (
mesh_dir.parent.name in {"FE", "cubes"}
or mesh_dir.name.endswith("calplate3d")
):
return meshconv.EMeshType.VOL
if mesh_dir.name.startswith(("tri", "quad")):
return meshconv.EMeshType.SURF
return None


if __name__ == "__main__":
sys.exit(main())
22 changes: 16 additions & 6 deletions data/bench/gen_bench_data.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
import numpy as np
import os

from riley.python import meshconv

def save_csv(path, data):
os.makedirs(os.path.dirname(path), exist_ok=True)
np.savetxt(path, data, delimiter=',', fmt='%.10f' if data.dtype == np.float64 else '%d')

def save_surface_mesh(out_dir, coords, connect):
connect = meshconv.enforce_mesh_convention(
meshconv.MeshData(
coords=np.ascontiguousarray(coords, dtype=np.float64),
connect={"connect1": np.ascontiguousarray(connect, dtype=np.int64)},
mesh_type="surface",
)
).connect["connect1"]
save_csv(f"{out_dir}/coords.csv", coords)
save_csv(f"{out_dir}/connect.csv", connect)

def get_nodes_for_elem(etype):
return {
"tri3": 3,
Expand Down Expand Up @@ -68,8 +81,7 @@ def generate_fullscreen(etype, out_dir):
else: connect = np.array([[0, 1, 2, 3, 4, 5, 6, 7, 8]])
else:
connect = np.array([[0, 1, 2, 3]])
save_csv(f"{out_dir}/coords.csv", coords)
save_csv(f"{out_dir}/connect.csv", connect)
save_surface_mesh(out_dir, coords, connect)
save_csv(f"{out_dir}/field.csv", compute_rgb_fields(coords))
save_csv(f"{out_dir}/uvs.csv", compute_uvs(coords))

Expand Down Expand Up @@ -102,8 +114,7 @@ def generate_grid(etype, out_dir, N=320):
q8 = [i0, i1, i2, i3, m01, m12, m23, m30]
if etype == "quad9": q8.append(i0+(xn+1)+1)
conn.append(q8)
save_csv(f"{out_dir}/coords.csv", coords)
save_csv(f"{out_dir}/connect.csv", np.array(conn))
save_surface_mesh(out_dir, coords, np.array(conn))
save_csv(f"{out_dir}/field.csv", compute_rgb_fields(coords))
save_csv(f"{out_dir}/uvs.csv", compute_uvs(coords))

Expand Down Expand Up @@ -199,8 +210,7 @@ def generate_sphere(etype, out_dir, N_target):
q.append((r + 1) * cols + (c + 1))
conn.append(q)

save_csv(f"{out_dir}/coords.csv", coords)
save_csv(f"{out_dir}/connect.csv", np.array(conn))
save_surface_mesh(out_dir, coords, np.array(conn))
save_csv(f"{out_dir}/uvs.csv", uvs)
save_csv(f"{out_dir}/field.csv", fields)

Expand Down
13 changes: 12 additions & 1 deletion data/calplate/main_gen_calplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from scipy.spatial.transform import Rotation
from scipy.stats import qmc

from riley.python import meshconv


BASE_DIR = Path(__file__).resolve().parent

Expand Down Expand Up @@ -445,11 +447,20 @@ def write_case(
connect: np.ndarray,
uvs: np.ndarray,
states: list[MotionState],
enforce_convention: bool = False,
) -> None:
out_dir = BASE_DIR / case_name
out_dir.mkdir(parents=True, exist_ok=True)

disp_x, disp_y, disp_z = displacement_fields(coords, states)
if enforce_convention:
connect = meshconv.enforce_mesh_convention(
meshconv.MeshData(
coords=np.ascontiguousarray(coords, dtype=np.float64),
connect={"connect1": np.ascontiguousarray(connect, dtype=np.int64)},
mesh_type="surface",
)
).connect["connect1"]

save_csv_matrix(out_dir / "coords.csv", coords, "%.10f")
save_csv_matrix(out_dir / "connect.csv", connect, "%d")
Expand Down Expand Up @@ -478,7 +489,7 @@ def main() -> None:
cases = mesh_cases()

for case_name, (coords, connect, uvs) in cases.items():
write_case(case_name, coords, connect, uvs, states)
write_case(case_name, coords, connect, uvs, states, enforce_convention=True)

print(f"Generated {len(cases)} calplate mesh cases in {BASE_DIR}")
print(f"Mode: {CAL_MODE}")
Expand Down
9 changes: 9 additions & 0 deletions data/cubes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Mesh-convention cube fixtures

These files are small CSV exports of PyVale's 10 mm element-test cubes.
`connectivity.csv` deliberately retains the source Exodus convention: it is
one-based and node-major. Riley mesh-convention tests use these fixtures to
verify normalization to zero-based, row-major connectivity.

The supported fixtures are `tet4`, `tet10`, `hex8`, `hex20`, and `hex27`.
`tet14` is retained as the explicit unsupported-topology fixture.
8 changes: 8 additions & 0 deletions data/cubes/hex20/connectivity.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
0,1,2,3,4,5,6,7,8,9,10,11,16,17,18,19,12,13,14,15
1,20,21,2,5,22,23,6,24,25,26,9,29,30,31,17,13,27,28,14
3,2,32,33,7,6,34,35,10,36,37,38,18,41,42,43,15,14,39,40
2,21,44,32,6,23,45,34,26,46,47,36,31,49,50,41,14,28,48,39
4,5,6,7,51,52,53,54,16,17,18,19,59,60,61,62,55,56,57,58
5,22,23,6,52,63,64,53,29,30,31,17,67,68,69,60,56,65,66,57
7,6,34,35,54,53,70,71,18,41,42,43,61,74,75,76,58,57,72,73
6,23,45,34,53,64,77,70,31,49,50,41,69,79,80,74,57,66,78,72
81 changes: 81 additions & 0 deletions data/cubes/hex20/coords.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
0,0,0
0.0050000000000000001,0,0
0.0050000000000000001,0.0050000000000000001,0
0,0.0050000000000000001,0
0,0,0.0050000000000000001
0.0050000000000000001,0,0.0050000000000000001
0.0050000000000000001,0.0050000000000000001,0.0050000000000000001
0,0.0050000000000000001,0.0050000000000000001
0.0025000000000000001,0,0
0.0050000000000000001,0.0025000000000000001,0
0.0025000000000000001,0.0050000000000000001,0
0,0.0025000000000000001,0
0,0,0.0025000000000000001
0.0050000000000000001,0,0.0025000000000000001
0.0050000000000000001,0.0050000000000000001,0.0025000000000000001
0,0.0050000000000000001,0.0025000000000000001
0.0025000000000000001,0,0.0050000000000000001
0.0050000000000000001,0.0025000000000000001,0.0050000000000000001
0.0025000000000000001,0.0050000000000000001,0.0050000000000000001
0,0.0025000000000000001,0.0050000000000000001
0.01,0,0
0.01,0.0050000000000000001,0
0.01,0,0.0050000000000000001
0.01,0.0050000000000000001,0.0050000000000000001
0.0074999999999999997,0,0
0.01,0.0025000000000000001,0
0.0074999999999999997,0.0050000000000000001,0
0.01,0,0.0025000000000000001
0.01,0.0050000000000000001,0.0025000000000000001
0.0074999999999999997,0,0.0050000000000000001
0.01,0.0025000000000000001,0.0050000000000000001
0.0074999999999999997,0.0050000000000000001,0.0050000000000000001
0.0050000000000000001,0.01,0
0,0.01,0
0.0050000000000000001,0.01,0.0050000000000000001
0,0.01,0.0050000000000000001
0.0050000000000000001,0.0074999999999999997,0
0.0025000000000000001,0.01,0
0,0.0074999999999999997,0
0.0050000000000000001,0.01,0.0025000000000000001
0,0.01,0.0025000000000000001
0.0050000000000000001,0.0074999999999999997,0.0050000000000000001
0.0025000000000000001,0.01,0.0050000000000000001
0,0.0074999999999999997,0.0050000000000000001
0.01,0.01,0
0.01,0.01,0.0050000000000000001
0.01,0.0074999999999999997,0
0.0074999999999999997,0.01,0
0.01,0.01,0.0025000000000000001
0.01,0.0074999999999999997,0.0050000000000000001
0.0074999999999999997,0.01,0.0050000000000000001
0,0,0.01
0.0050000000000000001,0,0.01
0.0050000000000000001,0.0050000000000000001,0.01
0,0.0050000000000000001,0.01
0,0,0.0074999999999999997
0.0050000000000000001,0,0.0074999999999999997
0.0050000000000000001,0.0050000000000000001,0.0074999999999999997
0,0.0050000000000000001,0.0074999999999999997
0.0025000000000000001,0,0.01
0.0050000000000000001,0.0025000000000000001,0.01
0.0025000000000000001,0.0050000000000000001,0.01
0,0.0025000000000000001,0.01
0.01,0,0.01
0.01,0.0050000000000000001,0.01
0.01,0,0.0074999999999999997
0.01,0.0050000000000000001,0.0074999999999999997
0.0074999999999999997,0,0.01
0.01,0.0025000000000000001,0.01
0.0074999999999999997,0.0050000000000000001,0.01
0.0050000000000000001,0.01,0.01
0,0.01,0.01
0.0050000000000000001,0.01,0.0074999999999999997
0,0.01,0.0074999999999999997
0.0050000000000000001,0.0074999999999999997,0.01
0.0025000000000000001,0.01,0.01
0,0.0074999999999999997,0.01
0.01,0.01,0.01
0.01,0.01,0.0074999999999999997
0.01,0.0074999999999999997,0.01
0.0074999999999999997,0.01,0.01
Loading
Loading