Skip to content

Instantly share code, notes, and snippets.

View Hermann-SW's full-sized avatar

Hermann Stamm-Wilbrandt Hermann-SW

View GitHub Profile
@Hermann-SW
Hermann-SW / amdgpu_temp
Created June 11, 2025 20:08
Table display of three temperatures for all installed AMD GPUs every second
#!/bin/bash
d=$(find /sys/class/drm/card?/device/unique_id | wc --l)
printf "%9s" "$(hostname)"
for((c=0;c<d;++c))
do
printf "|%s" "$(cat /sys/class/drm/card$c/device/unique_id)"
done
echo "|"
@Hermann-SW
Hermann-SW / demo_executions.md
Last active June 1, 2025 09:47
Fast discrete log() allows factoring RSA semiprimes easily

See comment below.

@Hermann-SW
Hermann-SW / C60.Hamilton_Cycle.jscad
Created May 28, 2025 23:25
JSCAD script console.logs Mathematica command FindHamiltonianCycle[...], and displays its results in JSCAD
"use strict"
const jscad = require('@jscad/modeling')
const { translate, rotate, scale:scale3d } = jscad.transforms
const { vec3 } = jscad.maths
const { colorize } = jscad.colors
const { sphere, cylinder } = jscad.primitives
const { add, length, subtract, scale } = jscad.maths.vec3
const phi=(Math.sqrt(5)+1)/2;
const build=[[0,1,3*phi],[1,2+phi,2*phi],[phi,2,2*phi+1]];
@Hermann-SW
Hermann-SW / utility.jscad
Last active June 15, 2025 15:32
K_{3,3} embedded on a Möbius strip (with Bezier curve edges)
"use strict";
const jscad = require("@jscad/modeling");
const { vec2, vec3} = jscad.maths;
const { bezier} = jscad.curves;
const { rotate, scale, translate } = jscad.transforms;
const { cuboid, sphere, cylinder } = jscad.primitives;
const { colorize } = jscad.colors;
const r=40;
const w=20;
@Hermann-SW
Hermann-SW / measure.gp
Created May 17, 2025 23:03
script demonstrating alternative for isprimepower() with very big primes
f1(N)={isprimepower(N,&r);return(r);}
f2(N)={return(lift(gcd(Mod(2,N)^N-2,N)));}
measure(f,N)={t0=getwalltime();f(N);t1=getwalltime();return(t1-t0);}
print("runtimes in milliseconds, with N=nextprime(base)^expo\n");
print("isprimepower(N,&r);return(r)");
{
printf(" |");for(e=2,15,printf("%3d|",e));print();
@Hermann-SW
Hermann-SW / E.jscad
Created April 27, 2025 14:56
part to join with a 2GPU Riser card model
"use strict"
const jscad = require('@jscad/modeling')
const { translate, rotateZ } = jscad.transforms
const { cuboid, sphere } = jscad.primitives
function main() {
return rotateZ(Math.PI/2,[
cuboid({size: [70,10,10]}),
translate([0,50,0], cuboid({size: [70,10,10]})),
translate([0,100,0], cuboid({size: [70,10,10]})),
@Hermann-SW
Hermann-SW / nohup.out
Last active March 21, 2025 21:04
1d 03:04 log of prpll(M_52) on Instinct MI50 GPU with memory overclocked with 1200MHz (analysis in comments)
m 1 1200
c
20250320 17:23:52 PRPLL 0.15-125-ga1349df starting
20250320 17:23:52 config: -device 0 -workers 1 -block 1000 -use FAST_BARRIER -use BIGLIT=1 -use BCAST=1 -use NONTEMPORAL=1 -use UNROLL_W=2
20250320 17:23:52 config: -prp 136279841
20250320 17:23:52 device 0, OpenCL 3635.0 (HSA1.1,LC), unique id 'd64a58a17330f0ed'
20250320 17:23:53 136279841 config: -DBCAST=1 -DBIGLIT=1 -DFAST_BARRIER=1 -DNONTEMPORAL=1 -DUNROLL_W=2
20250320 17:23:53 136279841 FFT: 7.50M 512:15:512:0:0 (17.33 bpw)
20250320 17:23:55 136279841 OK 0 on-load: blockSize 1000, 0000000000000003
20250320 17:23:55 136279841 Proof of power 10 requires about 17.1GB of disk space
@Hermann-SW
Hermann-SW / nohup.out
Last active April 26, 2025 18:42
Log of prpll on Instinct MI50 GPU with memory overclocked with 1200MHz on online list benchmark (analysis in comments)
m 1 1200
c
20250320 02:23:44 PRPLL 0.15-125-ga1349df starting
20250320 02:23:44 config: -device 0 -workers 1 -block 1000 -use FAST_BARRIER -use BIGLIT=1 -use BCAST=1 -use NONTEMPORAL=1 -use UNROLL_W=2
20250320 02:23:44 config: -prp 77936867
20250320 02:23:45 device 0, OpenCL 3635.0 (HSA1.1,LC), unique id 'd64a58a17330f0ed'
20250320 02:23:45 77936867 config: -DBCAST=1 -DBIGLIT=1 -DFAST_BARRIER=1 -DNONTEMPORAL=1 -DUNROLL_W=2
20250320 02:23:45 77936867 FFT: 4.50M 1K:9:256:1:0 (16.52 bpw)
20250320 02:23:47 77936867 OK 0 on-load: blockSize 1000, 0000000000000003
20250320 02:23:47 77936867 Proof of power 10 requires about 9.8GB of disk space
@Hermann-SW
Hermann-SW / utility.jscad
Last active June 15, 2025 15:34
K_{3,3} embedded on a torus
/*jslint node*/
"use strict";
const jscad = require("@jscad/modeling");
const {vec2, vec3} = jscad.maths;
const {colorize} = jscad.colors;
const {cylinder, sphere, torus} = jscad.primitives;
const {rotate, scale, translate} = jscad.transforms;
let edgeCylinder = cylinder({height: 1, radius: 0.01}); // cached
@Hermann-SW
Hermann-SW / M500000500001.gp
Created December 23, 2024 14:24
PARI/GP proof that Mersenne exponent 500000500001 does not give Mersenne prime (291.0g resident memory needed)
m=2^500000500001-1;
##
d=2 * 1663403835355 * 500000500001 + 1;
##
m%d
##
#binary(d)
##