Assessing package for production readiness#19
Conversation
Co-authored-by: jamestjsp <53532429+jamestjsp@users.noreply.github.com> Agent-Logs-Url: https://github.com/jamestjsp/controlsys/sessions/5883bf1e-30b1-4226-800b-b87cb1fcbb55
Co-authored-by: jamestjsp <53532429+jamestjsp@users.noreply.github.com> Agent-Logs-Url: https://github.com/jamestjsp/controlsys/sessions/5883bf1e-30b1-4226-800b-b87cb1fcbb55
jamestjsp
left a comment
There was a problem hiding this comment.
Review
Good changes
-
SetDelaydefensive copy — Real bug fix. Stores caller's matrix directly today, so mutations corrupt the system.copyDelayOrNilfix is correct and consistent withNew(). -
NewGaindefensive copy — Same aliasing bug, correct fix. -
README
Pole→Place— Correct, the function isPlace. -
Aliasing tests — Good coverage for
New,NewGain,NewFromSlices,SetDelay,NewWithDelay. -
doc.go godoc addition — Fine.
Concerns
-
NewFromSlicesperformance regression — The n>0 path previously usednewNoCopy, which was already safe sincemat.NewDense(n, m, freshSlice)owns its data. Routing throughNew()adds an unnecessarydenseCopySafeon every matrix (double allocation). The fix is only needed for the n==0/gain path — the n>0 path should stay asnewNoCopy. -
Production Readiness section — Verbose for a library README. The "release checklist" reads more like a blog post than API documentation. Consider moving to a separate
PRODUCTION.mdor trimming significantly. -
LFTDelay.Taualignment change (ss.go) — Cosmetic whitespace-only. Harmless but unnecessary diff noise.
|
@copilot address the concerns by code reviewer |
Co-authored-by: jamestjsp <53532429+jamestjsp@users.noreply.github.com> Agent-Logs-Url: https://github.com/jamestjsp/controlsys/sessions/5b398737-14b0-4852-b3f7-d5e22c5e4943
Updated in ac01800.
Addressed in ac01800. The follow-up commit restores the |
jamestjsp
left a comment
There was a problem hiding this comment.
All concerns addressed. NewFromSlices keeps newNoCopy for n>0, README trimmed, tests updated correctly. LGTM.
NewFromSlicesfast path for state-space systems while keeping gain-path copy safetyLFTDelay.Tauformatting change✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.