Skip to content

Conversation

@agnxsh
Copy link
Contributor

@agnxsh agnxsh commented Nov 26, 2025

No description provided.

@agnxsh agnxsh changed the title Recover parallel fixes for parallel reconstruction Nov 26, 2025
@github-actions
Copy link

github-actions bot commented Nov 26, 2025

Unit Test Results

       12 files  ±0    2 432 suites  ±0   48m 13s ⏱️ -22s
12 658 tests ±0  12 093 ✔️ ±0  565 💤 ±0  0 ±0 
63 636 runs  ±0  62 908 ✔️ ±0  728 💤 ±0  0 ±0 

Results for commit 820bcc6. ± Comparison against base commit 5649296.

♻️ This comment has been updated with latest results.

@agnxsh agnxsh marked this pull request as draft November 26, 2025 18:02
@siddarthkay
Copy link
Contributor

please re-run macos job I had to kill it to clean up macm4-01

var spawned = 0

# Choose a sane limit for concurrent tasks to reduce peak memory/alloc pressure.
let maxInFlight = if blobCount < 9: blobCount else: 9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

min(blobCount, 9)


# ---- Spawn phase with time limit ----
proc freePendingPtrPair(idxPtr: ptr CellIndex, cellsPtr: ptr Cell) =
if idxPtr != nil:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

free(NULL)/free(0) is fine and doesn't have to be guarded against

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf

7.20.3.2 The free function

...

The free function causes the space pointed to by ptr to be deallocated, that is, made available for further allocation. If ptr is a null pointer, no action occurs

# Allocate unmanaged C buffers and copy data into them
let
idxBytes = csize_t(columnCount) * csize_t(sizeof(CellIndex))
cellsBytes = csize_t(columnCount) * csize_t(sizeof(Cell))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what calloc does. It also accounts for potential alignment issues (i.e. due to alignment requirements, the size isn't just n*sizeof(y))

idxPtr = cast[ptr CellIndex](c_malloc(idxBytes))
if idxPtr == nil:
drainPending(0)
return err("Out of memory")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to have this Out of memory message be slightly more specific about its context and be easily distinguishable should it ever appear.

if cellsPtr == nil:
c_free(idxPtr)
drainPending(0)
return err("Out of memory")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to have this Out of memory message be slightly more specific about its context and be easily distinguishable should it ever appear.

localIndices[j] = idxArr[j]
localCells[j] = cellsArr[j]
# use the task wrapper which maps string errors to void
return recoverCellsAndKzgProofsTask(localIndices, localCells)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need return here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants