Skip to content

fix: linear init ramp and mutex-safe drop replacement#4

Merged
shr00mie merged 1 commit into
masterfrom
fix/drop-pool-mutex-ramp
Jun 9, 2026
Merged

fix: linear init ramp and mutex-safe drop replacement#4
shr00mie merged 1 commit into
masterfrom
fix/drop-pool-mutex-ramp

Conversation

@shr00mie

@shr00mie shr00mie commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace parabolic spawn-delay countdown with a 15s linear init ramp: (max_col_drops - 1) / 15 drops/sec, randomly staggered.
  • Serialize column deactivation and replacement spawn under cmatrix_spawn_mx via finish_column_and_replace().
  • Remove the racy active_col_count counter; derive active pool size from column_active[] under the lock.

Test plan

  • make clean && make
  • Run ./cmatrix for several minutes and confirm active drop count stays near 66% of terminal width

Replace the parabolic spawn-delay countdown with a 15s linear ramp:
(max_col_drops - 1) / 15 drops per second, with random stagger between spawns.

Guard column deactivation and replacement spawn in one cmatrix_spawn_mx
critical section (finish_column_and_replace). Drop the racy active_col_count
counter; derive the active pool size from column_active[] under the lock so
concurrent worker completions cannot skip replacement spawns over long runs.
@shr00mie shr00mie merged commit acc936c into master Jun 9, 2026
4 checks passed
@shr00mie shr00mie deleted the fix/drop-pool-mutex-ramp branch June 9, 2026 06:00
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.

1 participant