Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
89eed55
v2.4.0 (#327)
singaraiona Jul 11, 2026
eb66eed
feat(query): support live inserts into parted tables
singaraiona Jul 14, 2026
bbdc419
fix(core): restore total-core -c semantics
singaraiona Jul 15, 2026
9961388
fix(parse) Fix nonstring if not defined
protocolstardust Jul 16, 2026
6cac6e8
Merge pull request #330 from protocolstardust/dev
protocolstardust Jul 16, 2026
f44ab81
Merge branch 'master' into dev
singaraiona Jul 16, 2026
49d8524
fix(store): surface FlushFileBuffers failure in journal SYNC mode (#335)
belowzeroff Jul 18, 2026
cb1c6cd
fix(hnsw): reject build dims whose vector count overflows size_t (#333)
belowzeroff Jul 18, 2026
7475949
fix(store): read full link sidecar to avoid wrong-symbol truncation (…
belowzeroff Jul 18, 2026
ebadd07
fix(hnsw): reject index files whose vector count overflows size_t (#332)
belowzeroff Jul 21, 2026
fa39d9d
fix(docs): remediate F-0001 F-0005 F-0007
singaraiona Jul 22, 2026
ffd784f
fix(docs): remediate CF-0001
singaraiona Jul 22, 2026
1f27e61
fix(docs): remediate CF-0002
singaraiona Jul 22, 2026
465e58e
chore(audit): plan CF-0003 ratification
singaraiona Jul 22, 2026
8f8033c
fix(docs): remediate CF-0003
singaraiona Jul 22, 2026
3ae79f5
feat(docs): redesign website and documentation
singaraiona Jul 22, 2026
5dc8265
Merge branch 'master' into dev
singaraiona Jul 22, 2026
4d2c8f3
fix(null): avoid f64 null casts to integers (#340)
belowzeroff Jul 23, 2026
4e49626
fix(expr): avoid null truthiness casts in fallback binary ops (#339)
belowzeroff Jul 23, 2026
a05886d
ci: make Rayforce audit PR comments best-effort
singaraiona Jul 23, 2026
6ca3d8a
ci: publish Rayforce audit comments from trusted workflow
singaraiona Jul 23, 2026
04d8f3d
ci: resolve fork PRs for audit commenter
singaraiona Jul 23, 2026
6acdc2c
perf: parallelize serial stages around group-by; unify binary-agg nul…
ser-vasilich Jul 23, 2026
a53d98e
Merge branch 'master' into dev
singaraiona Jul 23, 2026
260e018
fix(aggr): preserve slice nullability in binary groups
singaraiona Jul 23, 2026
492c5db
fix(expr): avoid f64 null cast in fallback idiv integer output (#344)
belowzeroff Jul 23, 2026
d250108
fix(group): avoid f64 null read cast in dense aggs (#343)
belowzeroff Jul 23, 2026
95f0a3d
fix(ipc): preserve boxed data list args (#346)
belowzeroff Jul 24, 2026
e10d1ab
fix(group): avoid f64 null cast in DA reads (#348)
belowzeroff Jul 24, 2026
842acc0
ci: use portable march for fuzz jobs (#347)
belowzeroff Jul 24, 2026
84cea17
chore(release): merge master into dev
singaraiona Jul 24, 2026
7a5839e
fix(pivot): preserve generic missing cells as null (#350)
belowzeroff Jul 27, 2026
57628fb
fix(xbar): avoid narrow bucket truncation (#351)
belowzeroff Jul 28, 2026
d7a1f6f
Merge branch 'master' into dev
singaraiona Jul 28, 2026
c501ae0
fix(arith): reject float temporal operands (#353)
belowzeroff Jul 29, 2026
aea9bda
fix(ops): make nested (LIST) columns usable through a parted view (fi…
singaraiona Jul 30, 2026
0605f1a
fix(query): preserve temporal arithmetic semantics (#354)
belowzeroff Jul 30, 2026
282d3a1
Merge branch 'master' into dev
singaraiona Jul 30, 2026
17bf2b8
ci: skip audit comments for cancelled runs
singaraiona Jul 30, 2026
05c8078
fix(query): preserve if temporal branch types (#359)
belowzeroff Jul 31, 2026
488a296
fix(store): reject duplicate splayed column names (#360)
belowzeroff Aug 3, 2026
5684559
fix(builtins): reject malformed strings in TIMESTAMP cast (#361)
belowzeroff Aug 3, 2026
c9b9a66
fix(store): support nested column inserts and persistence (#365)
singaraiona Aug 3, 2026
4c0fa46
fix(eval): enforce restricted mode in compiled lambdas (#366)
singaraiona Aug 3, 2026
8c9300b
feat(core): add bounded poll step for embedders (#367)
singaraiona Aug 3, 2026
3c79632
Merge branch 'master' into dev
singaraiona Aug 3, 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
27 changes: 27 additions & 0 deletions include/rayforce.h
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,33 @@ ray_runtime_t* ray_runtime_create_with_sym_err(const char* sym_path,
* exactly one ray_runtime_create* call. */
void ray_runtime_destroy(ray_runtime_t* rt);

/* ===== Host-Driven Event Loop API =====
*
* Embedders that own the runtime thread can attach a poll to the runtime,
* create listeners from Rayfall (for example `(.sys.listen 7701)`), and
* service IPC and Rayfall timers in bounded slices. The runtime borrows
* the poll: detach and destroy it before destroying the runtime. */

typedef struct ray_poll ray_poll_t;

ray_poll_t* ray_poll_create(void);
void ray_poll_destroy(ray_poll_t* poll);

/* Run until ray_poll_exit is called. */
int64_t ray_poll_run(ray_poll_t* poll);

/* Serve events and timers for at most timeout_ms milliseconds.
* A negative timeout preserves ray_poll_run's blocking behavior; zero
* performs one non-blocking drain. Returns 0 (or an exit code) normally
* and -1 when poll is NULL or the platform event queue fails. */
int64_t ray_poll_run_for(ray_poll_t* poll, int timeout_ms);

void ray_poll_exit(ray_poll_t* poll, int64_t code);

/* The runtime borrows this pointer; pass NULL to detach it. */
void ray_runtime_set_poll(void* poll);
void* ray_runtime_get_poll(void);

/* Parse and evaluate a Rayfall source string against the global env.
* Returns RAY_NULL_OBJ for successful void / null results, an error ray_t*
* on failure (test with RAY_IS_ERR and inspect with ray_err_code), or the
Expand Down
22 changes: 19 additions & 3 deletions src/core/epoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,23 @@ void ray_poll_deregister(ray_poll_t* poll, int64_t id)
poll->sels[id] = NULL;
}

int64_t ray_poll_run(ray_poll_t* poll)
int64_t ray_poll_run_for(ray_poll_t* poll, int timeout_ms)
{
if (!poll) return -1;

struct epoll_event events[RAY_POLL_MAX_EVENTS];
bool bounded = timeout_ms >= 0;
int64_t end_ms = bounded ? ray_time_now_ms() + timeout_ms : INT64_MAX;

while (poll->code < 0) {
int wait_ms = -1;
if (bounded) {
int64_t remaining = end_ms - ray_time_now_ms();
if (remaining < 0) remaining = 0;
if (remaining > INT_MAX) remaining = INT_MAX;
wait_ms = (int)remaining;
}

if (poll->timers) {
int64_t deadline = ray_timers_next_deadline_ms(
(ray_timers_t*)poll->timers);
Expand All @@ -172,7 +181,8 @@ int64_t ray_poll_run(ray_poll_t* poll)
int64_t delta = deadline - now;
if (delta < 0) delta = 0;
if (delta > INT_MAX) delta = INT_MAX;
wait_ms = (int)delta;
if (wait_ms < 0 || delta < wait_ms)
wait_ms = (int)delta;
}
}

Expand Down Expand Up @@ -264,9 +274,15 @@ int64_t ray_poll_run(ray_poll_t* poll)

if (poll->timers)
ray_timers_fire_expired((ray_timers_t*)poll->timers);
if (bounded) break;
}

return poll->code;
return poll->code >= 0 ? poll->code : 0;
}

int64_t ray_poll_run(ray_poll_t* poll)
{
return ray_poll_run_for(poll, -1);
}

#endif /* __linux__ */
9 changes: 7 additions & 2 deletions src/core/iocp.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ void ray_poll_deregister(ray_poll_t* poll, int64_t id)
(void)poll; (void)id;
}

int64_t ray_poll_run(ray_poll_t* poll)
int64_t ray_poll_run_for(ray_poll_t* poll, int timeout_ms)
{
(void)poll;
(void)poll; (void)timeout_ms;
return -1;
}

int64_t ray_poll_run(ray_poll_t* poll)
{
return ray_poll_run_for(poll, -1);
}

#endif /* _WIN32 */
35 changes: 28 additions & 7 deletions src/core/kqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <sys/event.h>
#include <unistd.h>
#include <errno.h>
#include <limits.h>
#include <string.h>

#define RAY_POLL_MAX_EVENTS 64
Expand Down Expand Up @@ -159,28 +160,42 @@ void ray_poll_deregister(ray_poll_t* poll, int64_t id)
poll->sels[id] = NULL;
}

int64_t ray_poll_run(ray_poll_t* poll)
int64_t ray_poll_run_for(ray_poll_t* poll, int timeout_ms)
{
if (!poll) return -1;

struct kevent events[RAY_POLL_MAX_EVENTS];
bool bounded = timeout_ms >= 0;
int64_t end_ms = bounded ? ray_time_now_ms() + timeout_ms : INT64_MAX;

while (poll->code < 0) {
struct timespec ts;
struct timespec* timeout = NULL;
int64_t wait_ms = -1;
if (bounded) {
int64_t remaining = end_ms - ray_time_now_ms();
if (remaining < 0) remaining = 0;
wait_ms = remaining;
}

if (poll->timers) {
int64_t deadline = ray_timers_next_deadline_ms(
(ray_timers_t*)poll->timers);
if (deadline != INT64_MAX) {
int64_t now = ray_time_now_ms();
int64_t delta = deadline - now;
if (delta < 0) delta = 0;
ts.tv_sec = (time_t)(delta / 1000);
ts.tv_nsec = (long)((delta % 1000) * 1000000L);
timeout = &ts;
if (wait_ms < 0 || delta < wait_ms)
wait_ms = delta;
}
}

struct timespec ts;
struct timespec* timeout = NULL;
if (wait_ms >= 0) {
ts.tv_sec = (time_t)(wait_ms / 1000);
ts.tv_nsec = (long)((wait_ms % 1000) * 1000000L);
timeout = &ts;
}

int n = kevent((int)poll->fd, NULL, 0, events,
RAY_POLL_MAX_EVENTS, timeout);
if (n < 0) {
Expand Down Expand Up @@ -263,9 +278,15 @@ int64_t ray_poll_run(ray_poll_t* poll)

if (poll->timers)
ray_timers_fire_expired((ray_timers_t*)poll->timers);
if (bounded) break;
}

return poll->code;
return poll->code >= 0 ? poll->code : 0;
}

int64_t ray_poll_run(ray_poll_t* poll)
{
return ray_poll_run_for(poll, -1);
}

#endif /* __APPLE__ */
1 change: 1 addition & 0 deletions src/core/poll.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ void ray_poll_destroy(ray_poll_t* poll);
int64_t ray_poll_register(ray_poll_t* poll, ray_poll_reg_t* reg);
void ray_poll_deregister(ray_poll_t* poll, int64_t id);
int64_t ray_poll_run(ray_poll_t* poll);
int64_t ray_poll_run_for(ray_poll_t* poll, int timeout_ms);
void ray_poll_exit(ray_poll_t* poll, int64_t code);
ray_selector_t* ray_poll_get(ray_poll_t* poll, int64_t id);

Expand Down
29 changes: 29 additions & 0 deletions src/lang/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -2282,6 +2282,11 @@ op_storeglobal: {
ray_t *name_obj = cpool[idx];
/* `set` returns its value, so the result must stay on the stack;
* PEEK rather than POP. ray_env_set retains its own ref. */
if (RAY_UNLIKELY(__VM->restricted)) {
ray_release(POP());
vm_err_obj = ray_error("access", "restricted");
goto vm_error;
}
ray_t *val = PEEK();
ray_err_t err = ray_env_set(name_obj->i64, val);
if (err != RAY_OK) {
Expand All @@ -2296,6 +2301,11 @@ op_storeglobal_w: {
uint16_t idx = (uint16_t)((code[ip] << 8) | code[ip + 1]);
ip += 2;
ray_t *name_obj = cpool[idx];
if (RAY_UNLIKELY(__VM->restricted)) {
ray_release(POP());
vm_err_obj = ray_error("access", "restricted");
goto vm_error;
}
ray_t *val = PEEK();
ray_err_t err = ray_env_set(name_obj->i64, val);
if (err != RAY_OK) {
Expand Down Expand Up @@ -2327,6 +2337,12 @@ op_jmpf: {
op_call1: {
ray_t *arg = POP();
ray_t *fn_obj = POP();
if (RAY_UNLIKELY(fn_is_restricted(fn_obj))) {
ray_release(arg);
ray_release(fn_obj);
vm_err_obj = ray_error("access", "restricted");
goto vm_error;
}
ray_unary_fn fn = (ray_unary_fn)(uintptr_t)fn_obj->i64;
ray_t *result;
/* Materialise lazy args for non-lazy-aware fns.
Expand Down Expand Up @@ -2359,6 +2375,13 @@ op_call2: {
ray_t *right = POP();
ray_t *left = POP();
ray_t *fn_obj = POP();
if (RAY_UNLIKELY(fn_is_restricted(fn_obj))) {
ray_release(left);
ray_release(right);
ray_release(fn_obj);
vm_err_obj = ray_error("access", "restricted");
goto vm_error;
}
ray_binary_fn fn = (ray_binary_fn)(uintptr_t)fn_obj->i64;
ray_t *result;
/* Materialise lazy args for non-lazy-aware fns.
Expand Down Expand Up @@ -2407,6 +2430,12 @@ op_calln: {
for (int32_t i = n - 1; i >= 0; i--)
fn_args[i] = POP();
ray_t *fn_obj = POP();
if (RAY_UNLIKELY(fn_is_restricted(fn_obj))) {
for (int32_t i = 0; i < n; i++) ray_release(fn_args[i]);
ray_release(fn_obj);
vm_err_obj = ray_error("access", "restricted");
goto vm_error;
}
ray_vary_fn fn = (ray_vary_fn)(uintptr_t)fn_obj->i64;
if (!(fn_obj->attrs & RAY_FN_LAZY_AWARE)) {
ray_t* err = materialize_owned_args(fn_args, n);
Expand Down
Loading
Loading