Commit graph

62 commits

Author SHA1 Message Date
4e177047c9 fix: correct SEL_NUM bit-cast in gc test; assert n1 swept; add recompact to protocol comment 2026-04-30 03:55:15 +00:00
9a19a8f932 feat: export gc_clear_marks + gc_mark_select_tree; remove clear from gc_sweep (phase 6)
- Add gc_clear_marks(): iterates intern table and zeroes all gc_mark bits
- Rename static gc_mark_tree → public gc_mark_select_tree (no attribute((unused)))
- Remove Phase 6 guard (live_jobs != NULL early return) from gc_sweep_select_nodes
- Remove the mark-clear loop from gc_sweep_select_nodes; add (void) casts for now-unused params
- Declare gc_clear_marks and gc_mark_select_tree in resreq.h with protocol comment
- Add TDD test test_gc_clear_marks_exported verifying the exported primitives
- Prefix all existing gc_sweep_select_nodes(NULL, 0) call sites in test_select.c with gc_clear_marks()
2026-04-30 03:40:24 +00:00
b38babb7d6 feat: implement Phase 4d const-fold transform for select AST
Adds sel_const_fold_pass() — a single-pass bottom-up const-fold that
runs after the Phase 4c flatten loop in parse_select():

  4d-1  EQ/NE with either operand SEL_ANY → SEL_TRUE / SEL_FALSE
        (checks both child slots — commutativity sort makes SEL_ANY
        position non-deterministic after makeSelectNode interning)
  4d-2  Identity laws: TRUE&&X→X, X&&TRUE→X, FALSE||X→X, X||FALSE→X
  4d-3  Annihilation laws: FALSE&&X→FALSE, TRUE||X→TRUE (symmetric)
  4d-4  Complement laws: !TRUE→FALSE, !FALSE→TRUE

Memory semantics:
  level==0 (API server): frees orphaned nodes via free_select_node /
    sel_free_tree; OOM from makeSelectNode returns original node safely
  level>0  (CSE/scheduler): never manually frees; annihilation folds
    return the already-interned left/right singleton directly (no
    redundant makeSelectNode call); OOM guard unconditional so CSE
    mode also degrades gracefully instead of returning NULL

9 new TDD tests added to test_select.c (RED→GREEN verified).
All 166 tests pass (157 prior + 9 Phase 4d).
2026-04-29 08:24:04 +00:00
dcb1b4fe25 feat: P0-2a C-side plumbing for host control
Add the full call chain for host control operations from the Go API
server through the C library to the controller:

- schema/controller.capnp: HostControl struct + hostctrlmsg @21
  in Request.body union
- include/typemap.h: xce_hostctrl_t* hostctrlmsg in body union
  (placed after @20 clrpreasonmsg, matching capnp ordinal)
- include/client.h, xceapi.h, request.h: declarations for
  xcecli_hostctrl, xce_hostctrl, xce_hostctrl_req
- lib/client.c: xcecli_hostctrl (validate + delegate to xce_hostctrl)
- lib/xceapi.c: xce_hostctrl (validate ctx state + send + wait reply)
- lib/request.c: xce_hostctrl_req (validate hostname/empty/nil,
  accept only HOST_OPEN/HOST_CLOSE, reject HOST_TAG/UNTAG)
- lib/helper.c: Request_body_hostctrlmsg cases in
  xce_request_body() and xce_request_msg_name()
- controller/cluster.c: OPCode_hostcontrol dispatch
- controller/include/cluster.h: do_hostcontrol_op declaration
- controller/worker.c: do_hostcontrol_op + fix pre-existing
  goto-clean bug in worker_ctrl that leaked write lock and
  reference on HOST_OPEN/HOST_CLOSE no-op paths

TDD: 8 xce_hostctrl_req validation tests (null ep, null ctrl,
null/empty hostname, HOST_DO_NONE no-op, HOST_TAG/UNTAG reject,
negative action reject, HOST_OPEN/CLOSE accept via xce_request).

116/116 xcelib tests pass. CGO_ENABLED=0 Go backend tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 07:46:41 +00:00
43dc12a36c save works 2026-03-06 18:20:30 +08:00
3f74f14687 save works 2026-03-04 18:18:53 +08:00
acfbec875b save works 2026-03-03 16:49:26 +08:00
f4b1ba4cd7 save works 2026-03-02 12:14:30 +08:00
b748e30d20 save works 2026-02-28 17:55:50 +08:00
598d381379 improve xkvmgr and testsuite for scheduler 2026-02-26 14:39:12 +08:00
2ee87d4ee6 use librtti for worker/queue/resource 2026-02-25 16:56:50 +08:00
532c68e6e1 - add implement job related objs based on librtti
- add lock()/unlock() to job object
2026-02-23 11:18:45 +08:00
f582742e77 add xzarray_t for replacement of zarray_t finally 2026-02-20 11:25:50 +08:00
ce69347581 - implement xstring by librtti 2026-02-14 14:38:52 +08:00
15fac3cda1 introduce kv 2026-02-13 17:05:41 +08:00
48ea4a0205 - introduce bitset
- add hash_block()
2026-02-13 11:01:33 +08:00
12dcc2a60d - save tmp works
- save works
2026-02-06 17:31:02 +08:00
cd4f3953b2 - use librtti
- Fix issue to xce_get() api cause client side crash
- add parse resreq section
- add rusage parser
- parse resreq with basic support alternative & compound, still miss select
2026-02-05 17:21:27 +08:00
e7dc09c604 fix memory leak in controller and use lock protect apiserver data structure 2026-01-26 15:35:45 +08:00
9e07a1b227 improve api server support 2026-01-23 17:33:10 +08:00
3b728e5135 improve support of api server in controller 2026-01-23 16:05:23 +08:00
44fc5b23e9 push more to api server 2026-01-22 17:23:18 +08:00
00d161aa11 add more helper functions more example code 2026-01-21 16:34:04 +08:00
70970434ca initial work of api server 2026-01-20 18:20:24 +08:00
924bc1517b using xvec related api in scheduler 2026-01-16 18:21:37 +08:00
06209930f9 improve 2026-01-15 17:56:53 +08:00
ecf1916d78 support limit 2026-01-12 15:27:54 +08:00
bef32ace38 1st workable scheduler with resource from controller 2025-12-31 15:50:52 +08:00
780e9fb313 scheduling using real slots number 2025-12-30 18:13:15 +08:00
a27c8bfe6e enhance zarray library function 2025-12-26 16:23:04 +08:00
ae658c4a23 working of scheduler to handle configuration 2025-12-26 15:22:21 +08:00
a46ea822c1 working on scheduler and fix issue #17 2025-12-25 16:24:56 +08:00
4034fd7556 fix pkt size problem and fmt_jobid 2025-12-24 17:56:45 +08:00
088afe4ea0 scheduling job with fake resource 2025-12-23 18:12:13 +08:00
5560ae91da pass pend reason back to controller 2025-12-23 15:29:26 +08:00
c12fcf6905 improve ordq 2025-12-22 11:58:04 +08:00
2b190bdb1d format code 2025-12-18 17:39:09 +08:00
8d78f0cbeb improve resmgr/jobmgr/qmgr/workermgr 2025-12-18 17:37:34 +08:00
2362b32825 improve resmgr 2025-12-18 16:22:32 +08:00
1f1e4fdaba improve resmgr 2025-12-18 16:20:41 +08:00
4db6b039c5 save works 2025-12-18 14:55:58 +08:00
f44ad07116 improve ordq 2025-12-17 15:28:27 +08:00
48ab2e60a2 enhance ordq 2025-12-17 12:14:52 +08:00
e85ce0e5ad improve zarray_iter 2025-12-17 11:06:58 +08:00
05abed1964 enhance ordq 2025-12-16 17:04:04 +08:00
cb0c7fe9e7 merge job rusage and pending reason support 2025-12-16 14:36:28 +08:00
30824ae5ea create framework of scheduler 2025-12-12 17:57:12 +08:00
486b38d679 support passing args to request handle for elimination of global var 2025-12-11 17:07:51 +08:00
123b656dcf save work status 2025-12-10 17:24:43 +08:00
e497dd1b69 job submit and support run in worker 2025-11-28 17:24:31 +08:00