Commit Graph

789 Commits

Author SHA1 Message Date
hayodea 7ebdf14eb7 CMake: Document install requirements 2025-12-02 16:11:17 -04:00
hayodea 4f3462626d VSCode: move this into user config 2025-12-02 15:34:51 -04:00
hayodea e06b2d7e06 PcloudAmbienceStimBuff: Parse postrinThreshold as percentage 2025-12-02 14:15:43 -04:00
hayodea 33681059b0 Restore logic.h which was unintentionally deleted previously 2025-12-02 14:15:38 -04:00
hayodea 30f599cde3 Rename RangeDescriptor::bodySpot=>stimulusBufferSpot 2025-11-28 14:57:53 -04:00
hayodea 0116523a66 LG1PCloudAmbStncl: Use RangeDescriptor obj instead of StagingBuffer
We directly use an instance of RangeDescriptor to avoid incurring
the memory cost of using a StagingBuffer here. It's unnecessary
since these stencils will always be 32bits large.
2025-11-28 03:34:35 -04:00
hayodea 1f35dba2ca OClCollMeshEngn: use proper alignment for small StagingBuffer size
Aligning to uint32_t saves about 1 page of mem?
2025-11-28 03:13:55 -04:00
hayodea 280b6f7d1c OClCollMeshEngn: Produce ambience count; set postrin threshold
We modify the semantics/meaning of the ambience stim feature.
It now represents the number of frames whose average intensity
is below the ambienceLowVal.

We can now implement the postrin as the event wherein the number
of frames whose intensity <= ambienceLowVal exceeds
postrin-interest-threshold.
2025-11-28 02:55:24 -04:00
hayodea 5b19a70c75 Todo: document LivoxProto1/Gen1 port demux needs 2025-11-27 22:56:36 -04:00
hayodea 2a8d320f7a DevReattacher: Spinlock-protect stop() call
Replace the current delay timeout mechanism with a spinlock.
Both mechanisms try to eliminate the possibility of an in-flight
async op accessing state that has been destroyed by stop().

But the spinlock is less arbitrary.
2025-11-27 22:52:09 -04:00
hayodea 1e76d51c41 Todo: Update
By solving the issues in finalize() for IoUringAssmEngn and
OClCollMeshEngn, we've solved this as a side-effect.
2025-11-27 22:29:05 -04:00
hayodea 313454c426 OClCollMeshEngn: Add bridged delay in finalize()
See the diff of the todo file within this commit for more details.

In short, we do this to prevent the possibility of an in-flight async
contin accessing metadata that we've already destroyed after finalize()
has been called.
2025-11-27 22:26:50 -04:00
hayodea d49594ef88 IoUringAssmEngn: Add ~16ms bridged delay in finalize()
See the diff of the todo file within this patch for more
details.

This is to eliminate the possibility of having an in-flight async
contin access metadata that we destroyed in finalize().
2025-11-27 22:24:48 -04:00
hayodea e51d371f58 LG1PclAmbienceStencil: allocate stencils in constructor 2025-11-26 13:00:24 -04:00
hayodea 8eb7eaba3d Add PcloudAmbienceStencil, LG1PcloudAmbienceStencil
These two classes represent our first foray into stencil
construction. One of them standardizes PcloudAmbience stencils
across all stimbuffs, and the other specifies the internal
memory constraints and requirements for a LivoxGen1 device's
stencils.
2025-11-26 12:32:42 -04:00
hayodea ce0456d472 Docs: Add stencil notes 2025-11-26 11:16:28 -04:00
hayodea 49191b3a15 PcloudStimProd: ambienceHighVal is now a negtrin threshold 2025-11-26 03:39:39 -04:00
hayodea e5782b0af7 LivoxGen1: Add postrin thresholds (0, 10, and 30) 2025-11-26 03:34:47 -04:00
hayodea b6c426871e Docs: add params for postrin/negtrin thresholds 2025-11-26 03:33:38 -04:00
hayodea 5cce473e01 PcloudStimProd: make sh_ptrs to Pcloud*StimBuff atomic<>
This change is a bit pedantic, but since these vars aren't accessed
in any hotpath, it's fine to be pedantic. We made these sh_ptrs
atomic so we can use acquire and release side effects when loading
and storing them. This doesn't eliminate the problem of seeing
inconsistent state across microcontrollers, but it helps with simple
accesses like these ones we already do.
2025-11-26 00:14:15 -04:00
hayodea edab71b823 Todo: update 2025-11-23 23:13:23 -04:00
hayodea 3b8c1dac32 Stencil: use better examples in documentation comment 2025-11-23 23:12:49 -04:00
hayodea b0df1ef3d0 [Pcloud]StimProducer: Impl addAttachedStimBuffIfNotExists
Reduces code duplication, centralizes checking and enforces consistent
behaviour across producers.

Also reordered the writes to the sh_ptr<StimulusBuffer>s such that
the pointers are written last.
2025-11-23 23:11:23 -04:00
hayodea 617020b534 OClCollMeshEngn: Print values >= 116; not only > 2025-11-23 13:30:04 -04:00
hayodea d01e448b40 Git:ignore: ignore .cache dir with clangd metadata 2025-11-23 13:29:19 -04:00
hayodea 17c0e10be8 Salmanoff: Version increment to v0.01.001 v0.01.001 2025-11-23 07:35:21 -04:00
hayodea 9f839df36a Docs: Document ambience stimbuff and high-val param 2025-11-23 07:34:59 -04:00
hayodea 601c7857f4 VSCode: don't display inline greyed out hints 2025-11-23 07:28:04 -04:00
hayodea 0c2a14434b livoxGen1:OCl:collate: cast comparison to float 2025-11-23 07:25:53 -04:00
hayodea ce690bc3f4 PcloudStimProducer,OClCollMeshEngn: Produce ambience stim feature
The collation kernel now also produces the ambience stim feature
values into the ambience stimbuff frames.
2025-11-23 07:20:55 -04:00
hayodea e689063a8c StimFrame: Store ringbuff index as member var
Now each StimFrame knows its index within its parent SpMcRingbuff
object.
2025-11-23 06:15:54 -04:00
hayodea f57236530d OClCollMeshEngn: print intensities from intensity stimframes 2025-11-23 06:07:37 -04:00
hayodea 79df8b3f74 OClCollMeshEngn,PcloudStimProd: Produce into intensity stimbuff
PcloudStimulusBuffer::produceFrameReq():
Now correctly produces into the stim frames for the
PcloudIntensityStimulusBuffer object that's attached to the
PcloudStimulusProducer. If there's no attached I stimbuff, then
the OpenCL kernel will simply not write out the intensity data.

This is the first moment when we actually use the SP-MC ringbuffer
properly and actually cycle through the frames, producing into
them one by one.
2025-11-23 05:57:20 -04:00
hayodea a025d13fce CMake: Add support got clangd in cursor 2025-11-23 04:05:18 -04:00
hayodea 2c891bd2f3 Mrntt: Re-add exceptionInd
This now ensures that finalizeReq is indeed called from mrntt,
since exception-experiencing threads will post an exceptionInd
to mrntt, which will then call finalizeReq.
2025-11-23 03:27:18 -04:00
hayodea 3747dee8a7 CPack: Target ubuntu; deb now works in gdebi 2025-11-20 22:18:05 -04:00
hayodea 9ce1ced92d PcloudStimBuff,IoUringAssmEngn: add frame assembly perf profiling
We now time the frame assembly sequence.
2025-11-20 03:26:43 -04:00
hayodea 9e64c510cc SpMcRingBuff: Add getNextIndexForProducer/abortProduction
These two methods form the core of the SpMcRingbuffer's wrap-around
behaviour.
2025-11-20 03:06:35 -04:00
hayodea 9d9644cb31 PCloudStimBuff: Call stop=>start in destroyAttachedStimBuff
This ensures that we can avoid races when adding and removing
stimbuffs to a stimproducer.

At least in theory. I can think of some ways in which this current
design may result in races or other bad conditions.
2025-11-20 02:18:25 -04:00
hayodea 1bf0a195aa PcloudStimBuff: call stop=>start when adding new StimBuff 2025-11-20 02:10:11 -04:00
hayodea e233dc51d6 OClCollMeshEngn: hide StagingBuffer's firstSlotOffset 2025-11-20 01:48:59 -04:00
hayodea 51d2a70a3f StimProducer: add destroyAttachedStimulusBuffer virtual method
Implemented in base class and in derived class
PcloudStimulusProducer.
2025-11-20 01:25:46 -04:00
hayodea ee6405048a OClCollMeshEngn: use the central ComputeMgr APIs
We no longer create our own context and get our own OpenCL device
in OClCollMeshEngn::setup. We now request a device from the central
ComputeManager.
2025-11-20 00:55:19 -04:00
hayodea 2c7e090ef1 Move ClBuffer/ComputeDevice methods into libattachmentSupport 2025-11-20 00:53:28 -04:00
hayodea 0cfb0a9c07 StagingBuffer: Large slots should be aligned to alignment
Slots whose stride size is larger than the slot alignment value
should have their size rounded up to the alignment size so that
the slots that follow them will also be aligned.
2025-11-20 00:03:50 -04:00
hayodea 5789a31e23 StagingBuffer: add OpenCL buff handles to StimFrames 2025-11-19 23:43:17 -04:00
hayodea 27b43c6686 Add ComputeManager; add SmoHooks for getting ClDevices, buffers
We added a new centralized OpenCL Compute manager. This can later
be extended to support CUDA, SyCL, etc. SMO can be configured at
build time to choose which API it will use for compute.

Moreover, the ComputeMgr allows us to register buffers which are
available to all cl_contexts.
2025-11-19 22:34:25 -04:00
hayodea a910909ad5 Tests: Add test for StagingBuffer 2025-11-19 03:12:43 -04:00
hayodea 41b8385cb2 StimBuff: Use a single StagingBuffer for all StimFrames
We now allocate all the stimFrames for a StimBuffer using a
single StagingBuffer. This gives us all the benefits we're
looking for (pinning, alignment, etc).
2025-11-19 03:11:20 -04:00
hayodea 3f04d1b387 Stimulus[Buffer|Frame]: initial impl, unoptimized for mem use 2025-11-16 16:09:35 -04:00