proof-of-portfolio 0.0.106__py3-none-any.whl → 0.0.107__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- proof_of_portfolio/_version.py +1 -1
- proof_of_portfolio/circuits/components/src/core/omega.nr +20 -9
- proof_of_portfolio/circuits/target/circuits.json +1 -1
- proof_of_portfolio/circuits/vk/vk +0 -0
- {proof_of_portfolio-0.0.106.dist-info → proof_of_portfolio-0.0.107.dist-info}/METADATA +1 -1
- {proof_of_portfolio-0.0.106.dist-info → proof_of_portfolio-0.0.107.dist-info}/RECORD +9 -9
- {proof_of_portfolio-0.0.106.dist-info → proof_of_portfolio-0.0.107.dist-info}/WHEEL +0 -0
- {proof_of_portfolio-0.0.106.dist-info → proof_of_portfolio-0.0.107.dist-info}/entry_points.txt +0 -0
- {proof_of_portfolio-0.0.106.dist-info → proof_of_portfolio-0.0.107.dist-info}/top_level.txt +0 -0
proof_of_portfolio/_version.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
# This file is auto-generated during build
|
2
|
-
__version__ = "0.0.
|
2
|
+
__version__ = "0.0.107"
|
@@ -52,22 +52,33 @@ pub fn omega(
|
|
52
52
|
// negative_sum = product_sum_negative * sum_weights_positive
|
53
53
|
// final = (positive_sum * RATIO_SCALE_FACTOR) / max(abs(negative_sum), omega_loss_min)
|
54
54
|
|
55
|
-
//
|
56
|
-
let
|
57
|
-
let
|
55
|
+
// Scale down product_sums first to prevent overflow in cross-multiplication
|
56
|
+
let scale_factor = 1000000; // Scale down by 1M to prevent overflow
|
57
|
+
let product_sum_positive_scaled = product_sum_positive / scale_factor;
|
58
|
+
let product_sum_negative_scaled = product_sum_negative / scale_factor;
|
59
|
+
|
60
|
+
let positive_cross = product_sum_positive_scaled * sum_weights_negative;
|
61
|
+
let negative_cross = product_sum_negative_scaled * sum_weights_positive;
|
58
62
|
|
59
63
|
let abs_negative = if negative_cross >= 0 { negative_cross } else { -negative_cross };
|
60
|
-
let
|
64
|
+
let omega_loss_min_scaled = omega_loss_min / scale_factor;
|
65
|
+
let effective_denominator = if abs_negative >= omega_loss_min_scaled {
|
61
66
|
abs_negative
|
62
67
|
} else {
|
63
|
-
|
68
|
+
omega_loss_min_scaled
|
64
69
|
};
|
65
70
|
|
66
|
-
//
|
67
|
-
|
68
|
-
|
71
|
+
// Adjust final calculation to account for scale_factor
|
72
|
+
// Original formula: (positive_cross * RATIO_SCALE_FACTOR) / effective_denominator
|
73
|
+
// With scaling: (positive_cross_scaled * RATIO_SCALE_FACTOR * scale_factor) / effective_denominator_scaled
|
74
|
+
let adjusted_ratio_scale = RATIO_SCALE_FACTOR * scale_factor;
|
75
|
+
|
76
|
+
if effective_denominator >= adjusted_ratio_scale {
|
77
|
+
positive_cross / (effective_denominator / adjusted_ratio_scale)
|
78
|
+
} else if effective_denominator != 0 {
|
79
|
+
(positive_cross / effective_denominator) * adjusted_ratio_scale
|
69
80
|
} else {
|
70
|
-
|
81
|
+
0
|
71
82
|
}
|
72
83
|
} else {
|
73
84
|
let mut positive_sum: i64 = 0;
|