Commit Graph

229 Commits

Author SHA1 Message Date
hayodea d36d03dcc3 Logic/Concepts.h: Add combinational logic expr classes 2025-09-02 13:04:54 -04:00
hayodea 6362298016 Rename senseApiXcbWindow=>xcbWindow 2025-08-29 20:24:04 -04:00
hayodea 6314b0182a VSCode config: indentation should be 4-width tabs 2025-08-29 20:23:44 -04:00
hayodea 0fefa5be7f Add synchronization notes for queuespin mechanism 2025-08-29 19:59:22 -04:00
hayodea 7ea31cdb8d DAPSpecParser: Get rid of this warning 2025-08-29 17:52:39 -04:00
hayodea d217354689 Add our first async thread sequence
Gave me some ideas about how things should be structured. Apparently
merely using region-data-locked threads doesn't eliminate the need
for synchronization/locking. It just means your synchronization is much
lighter, in the form of localized variables.

It seems we'll need to maintain boolean trackers for certain
operations that shouldn't be performed concomitantly, and deny
the caller access to those operations in order to preserve
data sanity.

I guess we still ended up using locking after all. Tbh, I'm not even
sure this will make things end up being lighter: we may have to bounce
requests off, or perhaps re-enqueue them into the queue?

So maybe instead of bouncing requests off, we could re-add them to the
rear of the queue when they conflict with an ongoing request.
2025-08-29 17:42:13 -04:00
hayodea bb7be7fb3c Rename: senseDeviceSpecs => deviceAttachmentSpecs 2025-08-29 16:33:17 -04:00
hayodea ee8fca3008 Add todo 2025-08-29 16:13:03 -04:00
hayodea 525af45fd4 VSCode config: use 8-width tabs 2025-08-29 16:12:47 -04:00
hayodea 3ff329a553 Rename: DeviceSpec=>DAP Spec 2025-08-29 16:12:30 -04:00
hayodea 66257bcd0e Rename DSL: DeviceAttachmentSpec => deviceAttachmentPipeSpec
The new name is nicer and more distinguishing.
2025-08-29 15:55:11 -04:00
hayodea 6ef86eea05 Rename DSL: deviceSpec => deviceAttachmentSpec
This language is used broadly to specify how to attach (and thus
also how to detach) devices to/from Salmanoff. The next bit of work
we'll do is split off the DSL parsing from the management of the
list of parsed binary attached spec objects.

We'll be creating a PipeDeviceAttachmentParser, and later on when
we support URDF, we'll create a URDFDeviceAttachmentParser.
2025-08-29 15:16:11 -04:00
hayodea 8f41e164a2 Rename readDeviceFile=>readDeviceSpecFile 2025-08-29 13:29:18 -04:00
hayodea b9ca38bff1 Make senseApiLibs a vector<sh_ptr>; getters return sh_ptr
Proper reference and object lifetime management.
2025-08-29 13:20:15 -04:00
hayodea e024ccdf95 Add todo 2025-08-29 12:51:52 -04:00
hayodea f3f2384f9b SenseApiMgr: Refcount device spec objects 2025-08-29 09:50:26 -04:00
hayodea cd63593ae5 CMake: Add support for cross compiling to aarch64-linux-gnu 2025-08-23 20:59:39 -04:00
hayodea 58dbc7e320 Gitignore: Ignore all build dirs 2025-08-23 19:38:52 -04:00
hayodea e3795c4233 Fix includes to use angle brackets 2025-08-15 14:01:46 -04:00
hayodea edc198dd00 Document the purpose and mechanics behind JOLTing 2025-08-15 13:16:23 -04:00
hayodea 2bf7390f97 Rename implexa.h => mentenon.h 2025-08-15 09:43:38 -04:00
hayodea 1ea1b4b9f6 Fix typo 2025-08-15 09:41:34 -04:00
hayodea c14208f6ce Ignore /build dir 2025-08-15 09:38:43 -04:00
hayodea f4ff8f0e40 Delete superfluous files 2025-08-15 09:36:24 -04:00
hayodea ba3841c30b Rename classes from MentalExistent=>MentalPhenomenon 2025-08-13 16:06:34 -04:00
hayodea 4a8cb12294 Mrntt: initializeSalmanoff exceptions handled in outermode catch block
We don't post a message to the event loop telling it to execute
initializeSalmanoff anymore. We now execute it in the main control
flow.

Also, we've unified the logic to call finalizeReq() in response to
exceptions in the outermost try block.
2025-08-13 10:03:18 -04:00
hayodea b6b2ce7ada Cmdline: use exceptions for control flow
This is generally frowned upon but it makes this code 10x cleaner.
We handle commandLine usage msg printing by using exceptions for
control flow. This allows us to centralize the logic for killing
the Mind threads in one place. At least with respect to printing
the usage msg.
2025-08-13 09:49:54 -04:00
hayodea 7bee9b07ae Mrntt: Don't call Mind::initialize after exiting loop. 2025-08-13 09:08:57 -04:00
hayodea d26b791dd2 Handle SIGINT (CTL+C) by gracefully shutting down 2025-08-10 14:07:27 -04:00
hayodea 7579446388 Mrntt: set Mrntt::exitCode = EXIT_FAILURE for all exceptions 2025-08-10 13:40:13 -04:00
hayodea 099d60bcc4 Moved JOLT state tracking into ComponentThread:: 2025-08-10 13:29:34 -04:00
hayodea 42b32f27e6 Remove test exception 2025-08-10 13:17:11 -04:00
hayodea c457ee7aca smo::Mind instance now global; track & manage JOLT state in Mind
We moved the instance of smo::Mind to global scope. I suppose we'll
only support one instance of Mind per SMO process at least for now.

We now track the state of Mind threads' JOLT-waiting. This allows us
to centralize the Mind thread shutdown logic. Mind::finalizeReq()
now takes care of all Mind thread shutdown state logic by tracking
whether Mind threads need to be JOLTed first before being told to
exit.
2025-08-10 13:12:17 -04:00
hayodea e2e589dc17 ExceptionInd: Remove duplicate invocations 2025-08-03 10:33:34 -04:00
hayodea d4898bbca1 Add comments 2025-08-03 10:22:28 -04:00
hayodea e836b2bf32 Cmdline: Suppress getopt stderr msg, bubble exception upward instead 2025-08-03 10:19:22 -04:00
hayodea fef73692f7 Mrntt: Shut down mind threads before printing usage & exiting 2025-08-03 09:57:29 -04:00
hayodea 285b63b618 Mind: Distribute and pin Mind threads to CPUs
At startup, Marionette will distribute and pin the Mind
threads across the available CPUs, warning if it couldn't
do so.
2025-08-03 09:18:45 -04:00
hayodea 1deb92a416 CompThreads: create execOpOnAllMindThreads common helper
This allows us to execute an op on all mind threads without having
to repeatedly write loops. We've implemented wrappers to handle
start, pause, resume, exit and JOLT sequences.
2025-08-03 08:22:45 -04:00
hayodea 6f6fa77498 Get rid of enum Quale::Type, create BoundingQuale; use typeid()
We just learned about typeid. Apparently it was either not mentioned
in the Stroupstrup book or we totally missed it.
2025-08-03 05:23:05 -04:00
hayodea 79825e4da3 Make Quale derive from MentalExistent. 2025-08-03 05:06:14 -04:00
hayodea 6114a2648d Add MentalExistent hierarchy of classes.
These differ from the MentalEntity class hierarchy in that
MentalExistents are a narrower subset of MentalEntities. MentalEntities
refer to all mental content that needs to be persistently stored to
represent cognitive and personna state.

MentalExistents are content of the mind that specifically represents
existents. I.e: perceptual data, whether structural or implicative.
2025-08-03 05:06:14 -04:00
hayodea 4a3daaf403 Update README.md 2025-08-02 01:26:06 +00:00
hayodea 49c8b5bca1 SenseApiMgr: Print dev info when detaching, use early return pattern 2025-07-30 10:33:50 -04:00
hayodea a2598e80fd Mrntt: Call mind.finalize() on mind object. 2025-07-30 10:14:18 -04:00
hayodea 4fde28dad8 Mrntt: Call shutdownSalmanoff after exiting main loop
We moved initializeSalmanoff and shutdownSalmanoff into
salmanoff.cpp. Now we also invoke shutdownSalmanoff when exiting
to destroy subsystems and components gracefully.

This fixes the segfault that was thrown on every program exit
when xcbWindow had captured a window.
2025-07-30 10:09:25 -04:00
hayodea e276fcbdce Mrntt: use keepLooping after exception; Mind: split code from mrntt
Mrntt now has the event loop structure required to orderly shut itself
down when it itself generates an exception. We can now post a message
within the catch{} blocks for Mrntt's event loop, telling Mrntt
to shut down the Mind threads and then shut itself down.

We also split the code to initialize threads etc out of mrntt and
put it into the Mind:: namespace.
2025-07-30 09:09:38 -04:00
hayodea 36c79f3a2e Threading: run all code in PThreads, add JOLTing & exception bubbling
This commit significantly restructures the way we setup threading in
SMO. We now don't use the CRT main() thread at all. It's only used
as a mechanism to ensure that Marionette doesn't execute before
global constructors have been executed.

JOLTing:

This is a simple ASIO post()ed message that makes each thread setup
its thread-local data pointer to its own ComponentThread object,
and then enter its main ASIO run() loop to await commands from
Marionette.

Exception bubbling:

We now cleanly cause mind threads to report their exceptions
to marionette, so that marionette can cleanly shut the mind down
in an orderly fashion.

Thread Control messaging API:

A namespace of asynchronous messages to be post()ed to threads to
control them. It enables us to pause and resume threads. This will
be very useful for Marionette when we add the ability for it to
suspend Salmanoff's running mind, inject new goals, inspect current
state, etc; and then resume the mind's execution.
2025-07-28 07:20:44 -04:00
hayodea 513405a831 Cmdline: Rename senseApiLibs, senseApiPaths to apiLibs, apiLibPaths 2025-07-25 01:51:36 -04:00
hayodea 7b962a75d3 VSCode: update config 2025-07-25 01:22:13 -04:00