@@ -713,7 +713,7 @@ fn test_512_graph() {
713
713
assert_eq ! ( SubtensorModule :: get_dividends_for_uid( netuid, uid) , 1023 ) ; // Note D = floor(1 / 64 * 65_535) = 1023
714
714
assert_eq ! ( SubtensorModule :: get_emission_for_uid( netuid, uid) , 7812500 ) ; // Note E = 0.5 / 200 * 1_000_000_000 = 7_812_500
715
715
assert_eq ! ( bonds[ uid as usize ] [ validator] , 0.0 ) ;
716
- assert_eq ! ( bonds[ uid as usize ] [ server] , I32F32 :: from_num( 65_535 ) ) ;
716
+ assert_eq ! ( bonds[ uid as usize ] [ server] , I32F32 :: from_num( 7_489 ) ) ;
717
717
// Note B_ij = floor(1 / 64 * 65_535) / 65_535 = 1023 / 65_535, then max-upscaled to 65_535
718
718
}
719
719
for uid in servers {
@@ -1060,10 +1060,10 @@ fn test_bonds() {
1060
1060
P: [0.0499999989, 0.0999999992, 0.1500000006, 0.2000000011, 0.049998779, 0.1000006103, 0.1499963375, 0.2000042726]
1061
1061
emaB: [[(4, 0.2499999937), (5, 0.2499999953), (6, 0.2499999937), (7, 0.2499999937)], [(4, 0.4999999942), (5, 0.499999997), (6, 0.4999999942), (7, 0.4999999942)], [(4, 0.7499999937), (5, 0.7499999981), (6, 0.7499999995), (7, 0.7499999995)], [(4, 1), (5, 1), (6, 1), (7, 1)], [], [], [], []] */
1062
1062
let bonds = SubtensorModule :: get_bonds ( netuid ) ;
1063
- assert_eq ! ( bonds[ 0 ] [ 4 ] , 16383 ) ;
1064
- assert_eq ! ( bonds[ 1 ] [ 4 ] , 32767 ) ;
1065
- assert_eq ! ( bonds[ 2 ] [ 4 ] , 49151 ) ;
1066
- assert_eq ! ( bonds[ 3 ] [ 4 ] , 65535 ) ;
1063
+ assert_eq ! ( bonds[ 0 ] [ 4 ] , 2_147_430 ) ;
1064
+ assert_eq ! ( bonds[ 1 ] [ 4 ] , 4_294_861 ) ;
1065
+ assert_eq ! ( bonds[ 2 ] [ 4 ] , 6_442_293 ) ;
1066
+ assert_eq ! ( bonds[ 3 ] [ 4 ] , 8_589_724 ) ;
1067
1067
1068
1068
// === Set self-weight only on val1
1069
1069
let uid = 0 ;
@@ -1107,10 +1107,10 @@ fn test_bonds() {
1107
1107
P: [0.0449983515, 0.1011105615, 0.1516672159, 0.2022238704, 0.049998779, 0.1000006103, 0.1499963377, 0.2000042726]
1108
1108
emaB: [[(4, 0.2225175085), (5, 0.2225175085), (6, 0.2225175085), (7, 0.2225175085)], [(4, 0.499993208), (5, 0.4999932083), (6, 0.4999932083), (7, 0.4999932083)], [(4, 0.7499966028), (5, 0.7499966032), (6, 0.7499966032), (7, 0.7499966032)], [(4, 1), (5, 1), (6, 1), (7, 1)], [], [], [], []] */
1109
1109
let bonds = SubtensorModule :: get_bonds ( netuid ) ;
1110
- assert_eq ! ( bonds[ 0 ] [ 4 ] , 14582 ) ;
1111
- assert_eq ! ( bonds[ 1 ] [ 4 ] , 32767 ) ;
1112
- assert_eq ! ( bonds[ 2 ] [ 4 ] , 49151 ) ;
1113
- assert_eq ! ( bonds[ 3 ] [ 4 ] , 65535 ) ;
1110
+ assert_eq ! ( bonds[ 0 ] [ 4 ] , 0 ) ;
1111
+ assert_eq ! ( bonds[ 1 ] [ 4 ] , 42_948_61 ) ;
1112
+ assert_eq ! ( bonds[ 2 ] [ 4 ] , 6_442_293 ) ;
1113
+ assert_eq ! ( bonds[ 3 ] [ 4 ] , 8_589_724 ) ;
1114
1114
1115
1115
// === Set self-weight only on val2
1116
1116
let uid = 1 ;
@@ -1143,10 +1143,10 @@ fn test_bonds() {
1143
1143
P: [0.040496806, 0.0909997837, 0.157929636, 0.2105737738, 0.049998779, 0.1000006103, 0.1499963377, 0.2000042726]
1144
1144
emaB: [[(4, 0.192316476), (5, 0.192316476), (6, 0.192316476), (7, 0.192316476)], [(4, 0.4321515555), (5, 0.4321515558), (6, 0.4321515558), (7, 0.4321515558)], [(4, 0.7499967015), (5, 0.7499967027), (6, 0.7499967027), (7, 0.7499967027)], [(4, 1), (5, 1), (6, 1), (7, 1)], [], [], [], []] */
1145
1145
let bonds = SubtensorModule :: get_bonds ( netuid ) ;
1146
- assert_eq ! ( bonds[ 0 ] [ 4 ] , 12603 ) ;
1147
- assert_eq ! ( bonds[ 1 ] [ 4 ] , 28321 ) ;
1148
- assert_eq ! ( bonds[ 2 ] [ 4 ] , 49151 ) ;
1149
- assert_eq ! ( bonds[ 3 ] [ 4 ] , 65535 ) ;
1146
+ assert_eq ! ( bonds[ 0 ] [ 4 ] , 0 ) ;
1147
+ assert_eq ! ( bonds[ 1 ] [ 4 ] , 0 ) ;
1148
+ assert_eq ! ( bonds[ 2 ] [ 4 ] , 6_442_293 ) ;
1149
+ assert_eq ! ( bonds[ 3 ] [ 4 ] , 8_589_724 ) ;
1150
1150
1151
1151
// === Set self-weight only on val3
1152
1152
let uid = 2 ;
@@ -1179,10 +1179,10 @@ fn test_bonds() {
1179
1179
P: [0.0999999999, 0.2, 0.2999999998, 0.4, 0, 0, 0, 0]
1180
1180
emaB: [[(4, 0.1923094518), (5, 0.1923094518), (6, 0.1923094518), (7, 0.1923094518)], [(4, 0.4321507583), (5, 0.4321507583), (6, 0.4321507583), (7, 0.4321507583)], [(4, 0.7499961846), (5, 0.7499961846), (6, 0.7499961846), (7, 0.7499961846)], [(4, 1), (5, 1), (6, 1), (7, 1)], [], [], [], []] */
1181
1181
let bonds = SubtensorModule :: get_bonds ( netuid ) ;
1182
- assert_eq ! ( bonds[ 0 ] [ 7 ] , 12602 ) ;
1183
- assert_eq ! ( bonds[ 1 ] [ 7 ] , 28320 ) ;
1184
- assert_eq ! ( bonds[ 2 ] [ 7 ] , 49150 ) ;
1185
- assert_eq ! ( bonds[ 3 ] [ 7 ] , 65535 ) ;
1182
+ assert_eq ! ( bonds[ 0 ] [ 7 ] , 0 ) ;
1183
+ assert_eq ! ( bonds[ 1 ] [ 7 ] , 0 ) ;
1184
+ assert_eq ! ( bonds[ 2 ] [ 7 ] , 0 ) ;
1185
+ assert_eq ! ( bonds[ 3 ] [ 7 ] , 0 ) ;
1186
1186
1187
1187
// === Set val3->srv4: 1
1188
1188
assert_ok ! ( SubtensorModule :: set_weights( RuntimeOrigin :: signed( U256 :: from( 2 ) ) , netuid, vec![ 7 ] , vec![ u16 :: MAX ] , 0 ) ) ;
@@ -1214,10 +1214,10 @@ fn test_bonds() {
1214
1214
P: [0.0364437331, 0.081898629, 0.1635654932, 0.2180921442, 0, 0, 0, 0.5]
1215
1215
emaB: [[(4, 0.1922941932), (5, 0.1922941932), (6, 0.1922941932), (7, 0.1671024568)], [(4, 0.4321354993), (5, 0.4321354993), (6, 0.4321354993), (7, 0.3755230587)], [(4, 0.7499809256), (5, 0.7499809256), (6, 0.7499809256), (7, 0.749983425)], [(4, 1), (5, 1), (6, 1), (7, 1)], [], [], [], []] */
1216
1216
let bonds = SubtensorModule :: get_bonds ( netuid ) ;
1217
- assert_eq ! ( bonds[ 0 ] [ 7 ] , 10951 ) ;
1218
- assert_eq ! ( bonds[ 1 ] [ 7 ] , 24609 ) ;
1219
- assert_eq ! ( bonds[ 2 ] [ 7 ] , 49150 ) ;
1220
- assert_eq ! ( bonds[ 3 ] [ 7 ] , 65535 ) ;
1217
+ assert_eq ! ( bonds[ 0 ] [ 7 ] , 0 ) ;
1218
+ assert_eq ! ( bonds[ 1 ] [ 7 ] , 0 ) ;
1219
+ assert_eq ! ( bonds[ 2 ] [ 7 ] , 25_770_353 ) ;
1220
+ assert_eq ! ( bonds[ 3 ] [ 7 ] , 34_360_471 ) ;
1221
1221
1222
1222
next_block ( ) ;
1223
1223
if sparse { SubtensorModule :: epoch ( netuid, 1_000_000_000 ) ; }
@@ -1235,10 +1235,10 @@ fn test_bonds() {
1235
1235
P: [0.0327994274, 0.0737066122, 0.1686381293, 0.2248558307, 0, 0, 0, 0.5]
1236
1236
emaB: [[(4, 0.1922789337), (5, 0.1922789337), (6, 0.1922789337), (7, 0.1458686984)], [(4, 0.4321202405), (5, 0.4321202405), (6, 0.4321202405), (7, 0.3277949789)], [(4, 0.749965667), (5, 0.749965667), (6, 0.749965667), (7, 0.74998335)], [(4, 1), (5, 1), (6, 1), (7, 1)], [], [], [], []] */
1237
1237
let bonds = SubtensorModule :: get_bonds ( netuid ) ;
1238
- assert_eq ! ( bonds[ 0 ] [ 7 ] , 9559 ) ;
1239
- assert_eq ! ( bonds[ 1 ] [ 7 ] , 21482 ) ;
1240
- assert_eq ! ( bonds[ 2 ] [ 7 ] , 49150 ) ;
1241
- assert_eq ! ( bonds[ 3 ] [ 7 ] , 65535 ) ;
1238
+ assert_eq ! ( bonds[ 0 ] [ 7 ] , 0 ) ;
1239
+ assert_eq ! ( bonds[ 1 ] [ 7 ] , 0 ) ;
1240
+ assert_eq ! ( bonds[ 2 ] [ 7 ] , 25_770_353 ) ;
1241
+ assert_eq ! ( bonds[ 3 ] [ 7 ] , 34_360_471 ) ;
1242
1242
1243
1243
next_block ( ) ;
1244
1244
if sparse { SubtensorModule :: epoch ( netuid, 1_000_000_000 ) ; }
@@ -1256,10 +1256,10 @@ fn test_bonds() {
1256
1256
P: [0.029518068, 0.0663361375, 0.1732031347, 0.2309426593, 0, 0, 0, 0.5]
1257
1257
emaB: [[(4, 0.192263675), (5, 0.192263675), (6, 0.192263675), (7, 0.1278155716)], [(4, 0.4321049813), (5, 0.4321049813), (6, 0.4321049813), (7, 0.2872407278)], [(4, 0.7499504078), (5, 0.7499504078), (6, 0.7499504078), (7, 0.7499832863)], [(4, 1), (5, 1), (6, 1), (7, 1)], [], [], [], []] */
1258
1258
let bonds = SubtensorModule :: get_bonds ( netuid ) ;
1259
- assert_eq ! ( bonds[ 0 ] [ 7 ] , 8376 ) ;
1260
- assert_eq ! ( bonds[ 1 ] [ 7 ] , 18824 ) ;
1261
- assert_eq ! ( bonds[ 2 ] [ 7 ] , 49150 ) ;
1262
- assert_eq ! ( bonds[ 3 ] [ 7 ] , 65535 ) ;
1259
+ assert_eq ! ( bonds[ 0 ] [ 7 ] , 0 ) ;
1260
+ assert_eq ! ( bonds[ 1 ] [ 7 ] , 0 ) ;
1261
+ assert_eq ! ( bonds[ 2 ] [ 7 ] , 25_770_353 ) ;
1262
+ assert_eq ! ( bonds[ 3 ] [ 7 ] , 34_360_471 ) ;
1263
1263
1264
1264
next_block ( ) ;
1265
1265
if sparse { SubtensorModule :: epoch ( netuid, 1_000_000_000 ) ; }
@@ -1401,12 +1401,12 @@ fn test_bonds_with_liquid_alpha() {
1401
1401
// Active stake: [1, 2, 3, 4]
1402
1402
// ΔB = W◦S = [0.25*1, 0.5*2, 0.75*3, 1.0*4] = [0.25, 1.0, 2.25, 4.0]
1403
1403
// Normalize ΔB: [0.25/7.5, 1.0/7.5, 2.25/7.5, 4.0/7.5] = [0.0333, 0.1333, 0.3, 0.5333]
1404
- // Final bonds for netuid: [16383, 32767, 49151, 65535 ]
1404
+ // Final bonds for netuid: [530, 1_061, 1_591, 2_122 ]
1405
1405
1406
- assert_eq ! ( bonds[ 0 ] [ 4 ] , 16383 ) ; // Note: Calculated as explained above
1407
- assert_eq ! ( bonds[ 1 ] [ 4 ] , 32767 ) ; // Note: Calculated as explained above
1408
- assert_eq ! ( bonds[ 2 ] [ 4 ] , 49151 ) ; // Note: Calculated as explained above
1409
- assert_eq ! ( bonds[ 3 ] [ 4 ] , 65535 ) ; // Note: Calculated as explained above
1406
+ assert_eq ! ( bonds[ 0 ] [ 4 ] , 17_385_264 ) ; // Note: Calculated as explained above
1407
+ assert_eq ! ( bonds[ 1 ] [ 4 ] , 34_770_528 ) ; // Note: Calculated as explained above
1408
+ assert_eq ! ( bonds[ 2 ] [ 4 ] , 52_155_793 ) ; // Note: Calculated as explained above
1409
+ assert_eq ! ( bonds[ 3 ] [ 4 ] , 69_541_058 ) ; // Note: Calculated as explained above
1410
1410
1411
1411
// === Set self-weight only on val1
1412
1412
let uid = 0 ;
@@ -1425,10 +1425,10 @@ fn test_bonds_with_liquid_alpha() {
1425
1425
}
1426
1426
1427
1427
let bonds = SubtensorModule :: get_bonds ( netuid) ;
1428
- assert_eq ! ( bonds[ 0 ] [ 4 ] , 2862 ) ;
1429
- assert_eq ! ( bonds[ 1 ] [ 4 ] , 32767 ) ;
1430
- assert_eq ! ( bonds[ 2 ] [ 4 ] , 49151 ) ;
1431
- assert_eq ! ( bonds[ 3 ] [ 4 ] , 65535 ) ;
1428
+ assert_eq ! ( bonds[ 0 ] [ 4 ] , 0 ) ;
1429
+ assert_eq ! ( bonds[ 1 ] [ 4 ] , 34_770_528 ) ;
1430
+ assert_eq ! ( bonds[ 2 ] [ 4 ] , 52_155_793 ) ;
1431
+ assert_eq ! ( bonds[ 3 ] [ 4 ] , 69_541_058 ) ;
1432
1432
1433
1433
// === Set self-weight only on val2
1434
1434
let uid = 1 ;
@@ -1488,10 +1488,10 @@ fn test_bonds_with_liquid_alpha() {
1488
1488
Pruning Scores: [0.0016997808, 0.0151777493, 0.2070524206, 0.2760700488, 0.049998779, 0.1000006103, 0.1499963377, 0.2000042726]
1489
1489
*/
1490
1490
1491
- assert_eq ! ( bonds[ 0 ] [ 4 ] , 435 ) ;
1492
- assert_eq ! ( bonds[ 1 ] [ 4 ] , 4985 ) ;
1493
- assert_eq ! ( bonds[ 2 ] [ 4 ] , 49151 ) ;
1494
- assert_eq ! ( bonds[ 3 ] [ 4 ] , 65535 ) ;
1491
+ assert_eq ! ( bonds[ 0 ] [ 4 ] , 0 ) ;
1492
+ assert_eq ! ( bonds[ 1 ] [ 4 ] , 0 ) ;
1493
+ assert_eq ! ( bonds[ 2 ] [ 4 ] , 52155793 ) ;
1494
+ assert_eq ! ( bonds[ 3 ] [ 4 ] , 69_541_058 ) ;
1495
1495
} ) ;
1496
1496
}
1497
1497
@@ -1623,7 +1623,7 @@ fn test_active_stake() {
1623
1623
assert_eq ! ( * i, 0 ) ;
1624
1624
}
1625
1625
for i in bond. iter ( ) . take ( n as usize ) . skip ( ( n / 2 ) as usize ) {
1626
- assert_eq ! ( * i, I32F32 :: from_num( 65_535 ) ) ; // floor(0.5*(2^16 -1))/(2^16 -1), then max-upscale to 65_535
1626
+ assert_eq ! ( * i, I32F32 :: from_num( 26_843_545 ) ) ; // floor(0.5*(2^32 -1))/(2^32 -1)
1627
1627
}
1628
1628
}
1629
1629
let activity_cutoff: u64 = SubtensorModule :: get_activity_cutoff ( netuid) as u64 ;
@@ -1669,22 +1669,19 @@ fn test_active_stake() {
1669
1669
P: [0.275, 0.2249999999, 0.25, 0.25]
1670
1670
P (u16): [65535, 53619, 59577, 59577] */
1671
1671
let bonds = SubtensorModule :: get_bonds ( netuid) ;
1672
- assert_eq ! ( SubtensorModule :: get_dividends_for_uid( netuid, 0 ) , 36044 ) ; // Note D = floor((0.5 * 0.9 + 0.1) * 65_535)
1673
- assert_eq ! ( SubtensorModule :: get_emission_for_uid( netuid, 0 ) , 274999999 ) ; // Note E = 0.5 * 0.55 * 1_000_000_000 = 275_000_000 (discrepancy)
1672
+ assert_eq ! ( SubtensorModule :: get_dividends_for_uid( netuid, 0 ) , 65_535 ) ; // Note D = floor((0.5 * 0.9 + 0.1) * 65_535)
1673
+ assert_eq ! (
1674
+ SubtensorModule :: get_emission_for_uid( netuid, 0 ) ,
1675
+ 500_000_000
1676
+ ) ; // Note E = 0.5 * 0.55 * 1_000_000_000 = 275_000_000 (discrepancy)
1674
1677
for server in ( ( n / 2 ) as usize ) ..n as usize {
1675
- assert_eq ! ( bonds[ 0 ] [ server] , I32F32 :: from_num( 65_535 ) ) ; // floor(0.55*(2^16-1))/(2^16-1), then max-upscale
1678
+ assert_eq ! ( bonds[ 0 ] [ server] , I32F32 :: from_num( 107_374_182 ) ) ; // floor(0.55*(2^16-1))/(2^16-1), then max-upscale
1676
1679
}
1677
1680
for validator in 1 ..( n / 2 ) {
1678
- assert_eq ! (
1679
- SubtensorModule :: get_dividends_for_uid( netuid, validator) ,
1680
- 29490
1681
- ) ; // Note D = floor((0.5 * 0.9) * 65_535)
1682
- assert_eq ! (
1683
- SubtensorModule :: get_emission_for_uid( netuid, validator) ,
1684
- 224999999
1685
- ) ; // Note E = 0.5 * 0.45 * 1_000_000_000 = 225_000_000 (discrepancy)
1681
+ assert_eq ! ( SubtensorModule :: get_dividends_for_uid( netuid, validator) , 0 ) ; // Note D = floor((0.5 * 0.9) * 65_535)
1682
+ assert_eq ! ( SubtensorModule :: get_emission_for_uid( netuid, validator) , 0 ) ; // Note E = 0.5 * 0.45 * 1_000_000_000 = 225_000_000 (discrepancy)
1686
1683
for server in ( ( n / 2 ) as usize ) ..n as usize {
1687
- assert_eq ! ( bonds[ validator as usize ] [ server] , I32F32 :: from_num( 53619 ) ) ;
1684
+ assert_eq ! ( bonds[ validator as usize ] [ server] , I32F32 :: from_num( 0 ) ) ;
1688
1685
// floor(0.45*(2^16-1))/(2^16-1), then max-upscale
1689
1686
}
1690
1687
}
@@ -1730,15 +1727,21 @@ fn test_active_stake() {
1730
1727
P: [0.272501133, 0.2274988669, 0.25, 0.25]
1731
1728
P (u16): [65535, 54711, 60123, 60123] */
1732
1729
let bonds = SubtensorModule :: get_bonds ( netuid) ;
1733
- assert_eq ! ( SubtensorModule :: get_dividends_for_uid( netuid, 0 ) , 35716 ) ; // Note D = floor((0.55 * 0.9 + 0.5 * 0.1) * 65_535)
1734
- assert_eq ! ( SubtensorModule :: get_emission_for_uid( netuid, 0 ) , 272501132 ) ; // Note E = 0.5 * (0.55 * 0.9 + 0.5 * 0.1) * 1_000_000_000 = 272_500_000 (discrepancy)
1730
+ assert_eq ! ( SubtensorModule :: get_dividends_for_uid( netuid, 0 ) , 32_767 ) ; // Note D = floor((0.55 * 0.9 + 0.5 * 0.1) * 65_535)
1731
+ assert_eq ! (
1732
+ SubtensorModule :: get_emission_for_uid( netuid, 0 ) ,
1733
+ 250_000_000
1734
+ ) ; // Note E = 0.5 * (0.55 * 0.9 + 0.5 * 0.1) * 1_000_000_000 = 272_500_000 (discrepancy)
1735
1735
for server in ( ( n / 2 ) as usize ) ..n as usize {
1736
- assert_eq ! ( bonds[ 0 ] [ server] , I32F32 :: from_num( 65_535 ) ) ; // floor((0.55 * 0.9 + 0.5 * 0.1)*(2^16-1))/(2^16-1), then max-upscale
1736
+ assert_eq ! ( bonds[ 0 ] [ server] , I32F32 :: from_num( 53_687_090 ) ) ; // floor((0.55 * 0.9 + 0.5 * 0.1)*(2^16-1))/(2^16-1), then max-upscale
1737
1737
}
1738
- assert_eq ! ( SubtensorModule :: get_dividends_for_uid( netuid, 1 ) , 29818 ) ; // Note D = floor((0.45 * 0.9 + 0.5 * 0.1) * 65_535)
1739
- assert_eq ! ( SubtensorModule :: get_emission_for_uid( netuid, 1 ) , 227498866 ) ; // Note E = 0.5 * (0.45 * 0.9 + 0.5 * 0.1) * 1_000_000_000 = 227_500_000 (discrepancy)
1738
+ assert_eq ! ( SubtensorModule :: get_dividends_for_uid( netuid, 1 ) , 32_767 ) ; // Note D = floor((0.45 * 0.9 + 0.5 * 0.1) * 65_535)
1739
+ assert_eq ! (
1740
+ SubtensorModule :: get_emission_for_uid( netuid, 1 ) ,
1741
+ 250_000_000
1742
+ ) ; // Note E = 0.5 * (0.45 * 0.9 + 0.5 * 0.1) * 1_000_000_000 = 227_500_000 (discrepancy)
1740
1743
for server in ( ( n / 2 ) as usize ) ..n as usize {
1741
- assert_eq ! ( bonds[ 1 ] [ server] , I32F32 :: from_num( 54712 ) ) ; // floor((0.45 * 0.9 + 0.5 * 0.1)/(0.55 * 0.9 + 0.5 * 0.1)*(2^16-1))
1744
+ assert_eq ! ( bonds[ 1 ] [ server] , I32F32 :: from_num( 53_687_090 ) ) ; // floor((0.45 * 0.9 + 0.5 * 0.1)/(0.55 * 0.9 + 0.5 * 0.1)*(2^16-1))
1742
1745
}
1743
1746
} ) ;
1744
1747
}
@@ -1925,8 +1928,8 @@ fn test_outdated_weights() {
1925
1928
let bonds = SubtensorModule :: get_bonds ( netuid) ;
1926
1929
assert_eq ! ( SubtensorModule :: get_dividends_for_uid( netuid, 0 ) , 32767 ) ; // Note D = floor(0.5 * 65_535)
1927
1930
assert_eq ! ( SubtensorModule :: get_emission_for_uid( netuid, 0 ) , 250000000 ) ; // Note E = 0.5 * 0.5 * 1_000_000_000 = 249311245
1928
- assert_eq ! ( bonds[ 0 ] [ 2 ] , I32F32 :: from_num( 65_535 ) ) ; // floor(0.5*(2^16-1))/(2^16-1), then max-upscale
1929
- assert_eq ! ( bonds[ 0 ] [ 3 ] , I32F32 :: from_num( 65_535 ) ) ; // only uid0 has updated weights for new reg
1931
+ assert_eq ! ( bonds[ 0 ] [ 2 ] , I32F32 :: from_num( 47_721_615 ) ) ; // floor(0.5*(2^16-1))/(2^16-1), then max-upscale
1932
+ assert_eq ! ( bonds[ 0 ] [ 3 ] , I32F32 :: from_num( 0 ) ) ; // only uid0 has updated weights for new reg
1930
1933
} ) ;
1931
1934
}
1932
1935
0 commit comments