Skip to content

Conversation

@Varsius
Copy link
Collaborator

@Varsius Varsius commented Jan 20, 2026

No description provided.

Copy link
Member

@PhilippMatthes PhilippMatthes left a comment

Choose a reason for hiding this comment

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

Just some minor comments

return 0.0
}

return math.Min(1.0, totalWeightedUtilization/totalWeight)
Copy link
Member

Choose a reason for hiding this comment

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

Is it necessary to clamp the output weight? As tanh(-inf) = -1.0 and tanh(inf) = 1.0

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think so, since the highest value that should be possible is 1.0 which represents a perfect utilization of all resources and tanh(1.0)~=0.76. This prevents the case that a utilization calculation wrongly outputs a value greater than 1 which would result in a higher weight than tanh(1) and thus the node would get preferred over other nodes with perfect utilization. Does this make sense?

Copy link
Member

Choose a reason for hiding this comment

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

Right, thanks for the exaplanation.

@Varsius Varsius force-pushed the pods-binpack-weigher branch from eb87f46 to ae29e2e Compare January 20, 2026 14:25
@Varsius Varsius merged commit 1001f81 into cobaltcore-dev:main Jan 20, 2026
6 checks passed
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.

2 participants