Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add human readable 128bit output for 64 bit double word - IE: 3:13497924420419572192 reads 68,838156,641548,227040 #34

Open
obriensystems opened this issue Jan 11, 2025 · 4 comments
Assignees
Labels

Comments

@obriensystems
Copy link
Member

obriensystems commented Jan 11, 2025

Wen we get past 64 bits - it is hard to determine if the number is accurate or not
see
http://www.ericr.nl/wondrous/pathrecs.html

for example
GPU01:Sec: 93 GlobalMax: 0:23035537407: 3:13497924420419572192 last search: 23035576323

3:13497924420419572192
would read
68,838156,641548,227040

algorithm would be around multiplying the msb by 2^64

for start 0:23035537407
we reach 68,838156,641548,227040
= 3 x (18446744073709551616) + 13497924420419572192 
= 55340232221128654848 + 13497924420419572192
= 68838156641548227040

for start 0:2674309547647
we reach 770419,949849,742373,052272
(macos calc goes up to ~65 bits)
= 41764 * (18446744073709551616) + 10130355336659361648
= 7.70409819e23
= 7.7040995e23


GPU00:Sec: 6 GlobalMax: 0:1410123943: 0:7125885122794452160 last search: 1410170883
GPU00:Sec: 35 GlobalMax: 0:8528817511: 0:18144594937356598024 last search: 8528855043
GPU01:Sec: 50 GlobalMax: 0:12327829503: 1:2275654840695500112 last search: 12327895043
GPU01:Sec: 93 GlobalMax: 0:23035537407: 3:13497924420419572192 last search: 23035576323
GPU01:Sec: 186 GlobalMax: 0:45871962271: 4:8554672607184627540 last search: 45872005123
GPU01:Sec: 210 GlobalMax: 0:51739336447: 6:3959152699356688744 last search: 51739361283
GPU01:Sec: 240 GlobalMax: 0:59152641055: 8:3925412472713788616 last search: 59152711683
GPU01:Sec: 241 GlobalMax: 0:59436135663: 11:2822204561036784392 last search: 59436154883
GPU01:Sec: 285 GlobalMax: 0:70141259775: 22:15138744166779694152 last search: 70141296643
GPU01:Sec: 315 GlobalMax: 0:77566362559: 49:12722569465099770672 last search: 77566443523
GPU01:Sec: 449 GlobalMax: 0:110243094271: 74:7394588111761560776 last search: 110243102723
GPU01:Sec: 835 GlobalMax: 0:204430613247: 76:13308243407729068272 last search: 204430622723
GPU01:Sec: 948 GlobalMax: 0:231913730799: 118:13628023185147422868 last search: 231913799683
GPU01:Sec: 1114 GlobalMax: 0:272025660543: 1189:15304932029761092324 last search: 272025681923
GPU01:Sec: 1835 GlobalMax: 0:446559217279: 2143:1904360818491267984 last search: 446559272963
GPU01:Sec: 2337 GlobalMax: 0:567839862631: 5450:5418023868929928788 last search: 567839866883
GPU01:Sec: 3600 GlobalMax: 0:871673828443: 21714:6140004720918243904 last search: 871673856003
GPU01:Sec: 11158 GlobalMax: 0:2674309547647: 41764:10130355336659361648 last search: 2674309611523
@obriensystems obriensystems self-assigned this Jan 11, 2025
@obriensystems obriensystems changed the title Add 64bit output for double word Add human readable 128bit output for 64 bit double word - IE: 3:13497924420419572192 reads 68,838156,641548,227040 Jan 11, 2025
@obriensystems
Copy link
Member Author

ie: adding binary numbers - a current leetcode I am working on (tops out at 61 bits

// String a, String b
        return Long.toBinaryString(Long.parseLong(a,2) + Long.parseLong(b,2));
        // option 4: BigInteger - unlimited - except for the toBinaryString
        return Long.toBinaryString(new BigInteger(a,2).add(new BigInteger(b,2)).longValue());

obriensystems added a commit that referenced this issue Jan 19, 2025
@obriensystems
Copy link
Member Author

missing case for over 64 bits

mp: 0:4890328815 p: 1131 m: 0:319497287463520=319497287463520 ms: 9178 dur: 141
m0: 0:8528817511 p: 726 m: 0:18144594937356598024=18144594937356598024 ms: 108641 dur: 249
mp: 0:9780657631 p: 1132 m: 0:319497287463520=319497287463520 ms: 37513 dur: 287
mp: 0:12212032815 p: 1153 m: 0:319497287463520=319497287463520 ms: 73064 dur: 360
mp: 0:12235060455 p: 1184 m: 0:1037298361093936=1037298361093936 ms: 702 dur: 361
m0: 0:12327829503 p: 543 m: 1:2275654840695500112=20722398914405051726 ms: 2811 dur: 363
mp: 0:13371194527 p: 1210 m: 0:319497287463520=319497287463520 ms: 31595 dur: 395

1:2275654840695500112=20722398914405051726
should be
1:2275654840695500112=20722398914405051728

obriensystems added a commit that referenced this issue Jan 19, 2025
@obriensystems
Copy link
Member Author

working now

m0: 0:8528817511 p: 726 m: 0:18144594937356598024=18144594937356598024 ms: 110025 dur: 254
mp: 0:9780657631 p: 1132 m: 0:319497287463520=319497287463520 ms: 37909 dur: 292
mp: 0:12212032815 p: 1153 m: 0:319497287463520=319497287463520 ms: 74166 dur: 366
mp: 0:12235060455 p: 1184 m: 0:1037298361093936=1037298361093936 ms: 702 dur: 367
m0: 0:12327829503 p: 543 m: 1:2275654840695500112=20722398914405051728 ms: 2832 dur: 370

1:2275654840695500112=20722398914405051728

@obriensystems
Copy link
Member Author

check 13900a

micha@13900a MINGW64 /c/wse_github/obrienlabsdev/performance/cpu/virtual/multithreaded/128bit/java-benchmark-128-cli/performance-nbi (main)
$ java -cp target/performance-nbi-0.0.1-SNAPSHOT.jar dev.obrienlabs.performance.nbi.Collatz128bit 0 46 19
Collatz multithreaded 2025 michael at obrienlabs.dev: args searchStart searchEnd batch (both in bits: ie: 0 32 13 for 32 bit search space
Searching: 0 to 46 space, batch 0 of 524288 with 27 bits of 134217728 threads over a 19 batch size
m0: 0:105906179 p: 195 m: 0:476577808=476577808 ms: 2528 dur: 2
m0: 0:131072007 p: 115 m: 0:884736052=884736052 ms: 2531 dur: 2
m0: 0:122683393 p: 190 m: 0:368050180=368050180 ms: 2528 dur: 2
m0: 0:102760475 p: 275 m: 0:9009798964=9009798964 ms: 2737 dur: 2
mp: 0:119537665 p: 345 m: 0:358612996=358612996 ms: 2531 dur: 2
mp: 0:111149057 p: 270 m: 0:333447172=333447172 ms: 2529 dur: 2
mp: 0:97517599 p: 368 m: 0:5337795184=5337795184 ms: 2740 dur: 2
m0: 0:94371881 p: 567 m: 0:358601694532=358601694532 ms: 2742 dur: 2
m0: 0:117440539 p: 182 m: 0:30890738176=30890738176 ms: 2741 dur: 2
m0: 0:38797339 p: 253 m: 0:1061819908=1061819908 ms: 2532 dur: 2
m0: 0:48234511 p: 142 m: 0:488374432=488374432 ms: 2529 dur: 2
mp: 0:133169179 p: 353 m: 0:3644623168=3644623168 ms: 2740 dur: 2
m0: 0:106954799 p: 288 m: 0:71210751316=71210751316 ms: 2742 dur: 2
m0: 0:127926299 p: 221 m: 0:22432559416=22432559416 ms: 2740 dur: 2
m0: 0:60817435 p: 269 m: 0:4213199824=4213199824 ms: 2532 dur: 2
mp: 0:52428831 p: 455 m: 0:3228506080=3228506080 ms: 2740 dur: 2
mp: 0:22020109 p: 203 m: 0:66060328=66060328 ms: 2527 dur: 2
m0: 0:120586271 p: 190 m: 0:9397976128=9397976128 ms: 2740 dur: 2
m0: 0:124780571 p: 327 m: 0:33269200288=33269200288 ms: 2741 dur: 2
m0: 0:108003419 p: 407 m: 0:788100881200=788100881200 ms: 2746 dur: 2
mp: 0:94371881 p: 567 m: 0:358601694532=358601694532 ms: 0 dur: 2
m0: 0:89128961 p: 143 m: 0:267386884=267386884 ms: 2527 dur: 2
mp: 0:77594625 p: 241 m: 0:232783876=232783876 ms: 2528 dur: 2
m0: 0:72351759 p: 135 m: 0:732561568=732561568 ms: 2530 dur: 2
mp: 0:44040193 p: 173 m: 0:132120580=132120580 ms: 2527 dur: 2
mp: 0:121635039 p: 619 m: 0:527067306664=527067306664 ms: 0 dur: 2
m0: 0:120586303 p: 557 m: 0:1071516292360=1071516292360 ms: 1 dur: 2
m0: 0:38798183 p: 395 m: 0:1838700140128=1838700140128 ms: 20 dur: 2
mp: 0:106955617 p: 637 m: 0:13022272528=13022272528 ms: 20 dur: 2
m0: 0:97518969 p: 505 m: 0:55458724036804=55458724036804 ms: 0 dur: 2
mp: 0:89131711 p: 678 m: 0:55688506648=55688506648 ms: 0 dur: 2
m0: 0:97540219 p: 474 m: 0:80058454336744=80058454336744 ms: 83 dur: 2
mp: 0:94399149 p: 704 m: 0:159424614880=159424614880 ms: 12 dur: 2
m0: 0:119606763 p: 275 m: 0:94259207953024=94259207953024 ms: 73 dur: 2
m0: 0:111296127 p: 469 m: 0:421482397464772=421482397464772 ms: 1394 dur: 4
mp: 0:128081151 p: 738 m: 0:7209046267252=7209046267252 ms: 183 dur: 4
m0: 0:102921555 p: 487 m: 0:474637698851092=474637698851092 ms: 37 dur: 4
m0: 0:120074087 p: 570 m: 0:2185143829170100=2185143829170100 ms: 1245 dur: 5
m0: 0:120080895 p: 438 m: 0:3277901576118580=3277901576118580 ms: 13 dur: 5
mp: 0:98110761 p: 748 m: 0:159424614880=159424614880 ms: 46 dur: 5
mp: 0:103359483 p: 761 m: 0:159424614880=159424614880 ms: 10 dur: 5
mp: 0:129015023 p: 795 m: 0:3177300945976=3177300945976 ms: 1062 dur: 7
mp: 0:86010015 p: 797 m: 0:3177300945976=3177300945976 ms: 43 dur: 7
mp: 0:129177577 p: 813 m: 0:825525149213608=825525149213608 ms: 304 dur: 7
mp: 0:95592191 p: 947 m: 0:966616035460=966616035460 ms: 47 dur: 7
mp: 0:127456255 p: 950 m: 0:966616035460=966616035460 ms: 494 dur: 8
m0: 0:246666523 p: 514 m: 0:6404797161121264=6404797161121264 ms: 13338 dur: 21
mp: 0:169941673 p: 953 m: 0:966616035460=966616035460 ms: 1702 dur: 23
mp: 0:226588897 p: 956 m: 0:966616035460=966616035460 ms: 2279 dur: 25
m0: 0:380379879 p: 644 m: 0:11840694835853140=11840694835853140 ms: 5233 dur: 30
mp: 0:302118529 p: 959 m: 0:966616035460=966616035460 ms: 950 dur: 31
m0: 0:379027947 p: 600 m: 0:1414236446719942480=1414236446719942480 ms: 3063 dur: 34
mp: 0:268549803 p: 964 m: 0:966616035460=966616035460 ms: 1551 dur: 36
mp: 0:670617279 p: 986 m: 0:966616035460=966616035460 ms: 20544 dur: 56
m0: 0:9223372038131106217 p: 619 m: 36:9060257381000498836=673143044034544357012 ms: 53170 dur: 109
mp: 0:1341234559 p: 987 m: 0:966616035460=966616035460 ms: 2416 dur: 112
mp: 0:1412987847 p: 1000 m: 0:966616035460=966616035460 ms: 9634 dur: 121
mp: 0:1674652263 p: 1008 m: 0:966616035460=966616035460 ms: 27872 dur: 149
mp: 0:2610744987 p: 1050 m: 0:966616035460=966616035460 ms: 84217 dur: 234
mp: 0:4578853915 p: 1087 m: 0:966616035460=966616035460 ms: 186001 dur: 420
mp: 0:4890328815 p: 1131 m: 0:319497287463520=319497287463520 ms: 22315 dur: 442
mp: 0:9780657631 p: 1132 m: 0:319497287463520=319497287463520 ms: 455031 dur: 897

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant