@ai-ecoverse/slicc-kernel 1.100.1 → 1.100.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -298,6 +298,7 @@ On top of preview1 a WASI program gets:
298
298
  - **Waiting:**
299
299
  - `how` 0 blocks; 1 tries (`EAGAIN`); 2 waits until `deadline_ns` on `clock` (0 `CLOCK_REALTIME`, as `sem_timedwait`; 1 `CLOCK_MONOTONIC`, as `sem_clockwait`).
300
300
  - A timed wait gives `ETIMEDOUT`, never early, also when the deadline has already passed. A negative deadline is `EINVAL`.
301
+ - A wait stopped by job control (`SIGSTOP`, `^Z`) goes on after `SIGCONT`, and a timed one still ends at its deadline: the time spent stopped counts, and the wait isn't restarted with the whole timeout.
301
302
  - A wait blocks only its own thread, and a signal handler ends it with `EINTR`.
302
303
  - **Posting:** `sem_post` gives the unit to the longest-waiting thread, or adds it to the value; at the maximum it's `EOVERFLOW`.
303
304
  - **Lifetime:**
@@ -897,7 +898,7 @@ Releases are cut by semantic-release on every push to `main`, in two jobs, and o
897
898
 
898
899
  - **plan:** works out the version, the previous tag, the commit and the base (`base.mjs`). The base is the newest earlier release whose `cert-review` commit status is `success`, or, until there is one, the release `base.json` names (the cert lane's last line). CI never reads the npm `certified` dist-tag.
899
900
  - **delta** (`delta.mjs`): lists the pull requests merged between the two tags (their merge commits, plus `pr` for a planted branch). Each gets its conventional-commit kind (`fix`, `feat`, `perf` and `revert` are behaviour changes) and the integration test files and titles it adds or changes. The titles are read from the pull request's patch: the added `test(…)` lines and the hunk headers git puts above changed lines. Escapes are decoded as JavaScript does, and a title git cut short, or a template literal, matches as a prefix.
900
- - **suite** (`suite.mjs`, `reporter.mjs`) runs on the bench pool, without secrets. It takes the tag's tree with its own dependencies and Chromium, and replaces `dist/` with the **published npm tarball** (for a planted branch, its own `npm pack`).
901
+ - **suite** (`suite.mjs`, `reporter.mjs`) runs on the bench pool, without secrets. It takes the tag's tree with its own dependencies and Chromium, and replaces `dist/` with the **published npm tarball** (for a planted branch, its own `npm pack`). The test command runs in a session of its own (`detached`), and `suite.mjs` notes a `SIGINT` (`ignored` in its summary) instead of dying of it. That way a stray signal to the step's process group can't cut the run short, while a `SIGTERM` (a real cancel) still ends it.
901
902
  - The release job runs the release's whole `test/integration/` suite, then the delta's test files again on the **previous release's dist** (the NEGATIVE).
902
903
  - The base job runs the base release's own suite on its own published dist.
903
904
  - Each run uses the tree's own `npm test` command, with a reporter that records every test and subtest with its status and error.
@@ -1010,12 +1011,12 @@ Two builds of one C program (`forktls.c` with `tlsvars.c`), a position-independe
1010
1011
 
1011
1012
  A WASIX C program for `test/integration/semaphore.test.mjs` (#717). It calls the `slicc.sem_*` imports directly (`import_module("slicc")`), so the rows don't wait for the libc side. `semtest MODE` runs one of:
1012
1013
  - `handoff`, `inherit`, `spawn` (a spawned and an exec'd image open the semaphore by name; exec drops the handles);
1013
- - `try`, `timed`, `eintr`;
1014
+ - `try`, `timed`, `eintr`, `stopped` (a forked child's 300 ms timed wait is stopped for 200 ms and continued, and reports whether it ended at the deadline);
1014
1015
  - `threads` (FIFO, one thread blocked at a time);
1015
1016
  - `errors`, `unlink`, `owners setup|user`;
1016
1017
  - `killed` (a waiter killed before posts loses no unit), `exited`, `cap`, `handles`.
1017
1018
 
1018
- **Build:** `WASIX_SYSROOT_28=/path/to/wasix-sysroot ./build.sh`, with `wasixcc` 0.4.7 (legacy exceptions, `-pthread`) and binaryen's `wasm-opt` (version 132, `--asyncify` for `proc_fork`) on `PATH`. `bin/semtest.wasm` is 68,078 bytes, sha256 `44178ed41ec8499c3c562b559b961438db135ca0914cc38c12316b8ab2d4e3f1`.
1019
+ **Build:** `WASIX_SYSROOT_28=/path/to/wasix-sysroot ./build.sh`, with `wasixcc` 0.4.7 (legacy exceptions, `-pthread`) and binaryen's `wasm-opt` (version 132, `--asyncify` for `proc_fork`) on `PATH`. `bin/semtest.wasm` is 68,438 bytes, sha256 `af3d38d87b63fa219bae90b1225376882ba20ace423c5ce24ef57935e80e2fde`.
1019
1020
 
1020
1021
  ### `wlocktest`
1021
1022
 
@@ -12114,7 +12114,7 @@ var PATH_OPS = new Set(SYNC_FS_OPS);
12114
12114
  var EARLY_WHOLE_FILE = 64 * 1024;
12115
12115
 
12116
12116
  // src/version.ts
12117
- var KERNEL_VERSION = true ? "1.100.1" : "0.0.0-dev";
12117
+ var KERNEL_VERSION = true ? "1.100.2" : "0.0.0-dev";
12118
12118
  var OS_RELEASE = "6.0.0-slicc";
12119
12119
  function procVersion() {
12120
12120
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -14589,6 +14589,13 @@ var SEM_NAMES_MAX = 4096;
14589
14589
  var SEM_HANDLES_MAX = 256;
14590
14590
  var NAME_MAX = 251;
14591
14591
  var TIMER_MAX_MS = 2147483647;
14592
+ var deadlines = /* @__PURE__ */ new WeakMap();
14593
+ function timeLeft(req, timeoutMs) {
14594
+ const now = performance.now();
14595
+ const deadline = deadlines.get(req) ?? now + timeoutMs;
14596
+ deadlines.set(req, deadline);
14597
+ return Math.max(0, deadline - now);
14598
+ }
14592
14599
  var SEM_OPS = [
14593
14600
  "sem-open",
14594
14601
  "sem-close",
@@ -14775,8 +14782,9 @@ async function semSyscall(req, proc) {
14775
14782
  const sem = handles.get(req.handle);
14776
14783
  if (sem.take()) return ok2();
14777
14784
  if (req.how === "try") throw new KernelError("EAGAIN");
14778
- if (req.how === "timed" && req.timeoutMs === 0) throw new KernelError("ETIMEDOUT");
14779
- const got = await sem.wait(proc.blocking(), req.how === "block" ? -1 : req.timeoutMs);
14785
+ const timeoutMs = req.how === "block" ? -1 : timeLeft(req, req.timeoutMs);
14786
+ if (timeoutMs === 0) throw new KernelError("ETIMEDOUT");
14787
+ const got = await sem.wait(proc.blocking(), timeoutMs);
14780
14788
  if (!got) throw new KernelError("ETIMEDOUT");
14781
14789
  return ok2();
14782
14790
  }