24aa: 563a60 confirmed GUI-branch (detector-LUT params absent from audio-instance memory — full rw-scan); audio-path level compression lives in step 1-19 op semantics (bigkernels/fma/combine); memory-scan tools added

This commit is contained in:
2026-08-25 01:42:16 +03:00
parent 65ee61d540
commit 47c5360ac2
4 changed files with 215 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
#!/usr/bin/env python3
"""probe_lut.py — one-shot probe of [ctx+0x180] LUT params during render."""
import struct, subprocess, sys, time
import glob, os
def find_host():
for p in glob.glob('/proc/[0-9]*'):
pid = int(os.path.basename(p))
try:
cmd = open(f'/proc/{pid}/cmdline','rb').read().replace(b'\0',b' ').decode('utf8','replace')
maps = open(f'/proc/{pid}/maps').read()
except Exception:
continue
if 'soothe2' in maps and 'reaper' not in cmd:
return pid
return None
subprocess.run("pkill -9 -x reaper; pkill -9 -f '[y]abridge'; "
"rm -rf /run/user/1000/yabridge-soothe2_x64-*; sleep 1", shell=True)
rpp = sys.argv[1] if len(sys.argv) > 1 else '/home/m/soothe-bt/dual_b1q_0.5.rpp'
proc = subprocess.Popen(['/usr/bin/reaper','-nosplash','-ignoreerrors','-renderproject', rpp],
stdout=open('/dev/null','w'), stderr=subprocess.STDOUT)
t0=time.time(); host=None
while time.time()-t0<30 and not host:
host=find_host(); time.sleep(0.001)
print('host',host, flush=True)
if not host:
sys.exit(1)
fd=os.open(f'/proc/{host}/mem',os.O_RDONLY)
def rd(a,n):
try: return os.pread(fd,n,a)
except OSError: return None
ctx=0x2370040
best=None
while time.time()-t0 < 12:
b=rd(ctx+0x180,8)
v=struct.unpack('<Q',b)[0] if b else 0
if 0x10000 < v < 0x7ffff0000000:
s=rd(v,0x18)
if s:
A,B=struct.unpack('<ff',s[0:8]); G=struct.unpack('<f',s[12:16])[0]
m=s[16]
q90=rd(v+0x90,8)
p90=struct.unpack('<Q',q90)[0] if q90 else 0
rec=(A,B,G,m,p90)
if best is None or rec!=best:
best=rec
print('t=%.2f [ctx+180]=%x A=%.6g B=%.6g G=%.6g mode=%d vt90=%x' %
(time.time()-t0,v,A,B,G,m,p90), flush=True)
else:
print('t=%.2f [ctx+180]=%x (not ptr)' % (time.time()-t0,v), flush=True)
time.sleep(0.05)
os.close(fd)
+79
View File
@@ -0,0 +1,79 @@
#!/usr/bin/env python3
"""scan_lutsub.py v2 — range-filtered scan for detector-LUT param subs.
Filter: -60<A<-1, 1<B<100, 0.2<G<8, mode in {0,1}, [+0x90] valid pointer.
Prints unique (A,B,G,mode) tuples with addresses.
"""
import struct, subprocess, sys, time
import glob, os
import numpy as np
def find_host():
for p in glob.glob('/proc/[0-9]*'):
pid = int(os.path.basename(p))
try:
cmd = open(f'/proc/{pid}/cmdline','rb').read().replace(b'\0',b' ').decode('utf8','replace')
maps = open(f'/proc/{pid}/maps').read()
except Exception:
continue
if 'soothe2' in maps and 'reaper' not in cmd:
return pid
return None
subprocess.run("pkill -9 -x reaper; pkill -9 -f '[y]abridge'; "
"rm -rf /run/user/1000/yabridge-soothe2_x64-*; sleep 1", shell=True)
rpp = sys.argv[1] if len(sys.argv) > 1 else '/home/m/soothe-bt/dual_b1q_0.5.rpp'
proc = subprocess.Popen(['/usr/bin/reaper','-nosplash','-ignoreerrors','-renderproject', rpp],
stdout=open('/dev/null','w'), stderr=subprocess.STDOUT)
t0=time.time(); host=None
while time.time()-t0<30 and not host:
host = find_host(); time.sleep(0.002)
print('host', host, flush=True)
if not host:
sys.exit(1)
fd = os.open(f'/proc/{host}/mem', os.O_RDONLY)
def rd(a,n):
try: return os.pread(fd,n,a)
except OSError: return None
seen={}
alive=True
t_end=time.time()+12
while time.time()<t_end and alive:
try:
for line in open(f'/proc/{host}/maps'):
parts=line.split()
if 'rw' not in parts[1]: continue
lo,hi=(int(x,16) for x in parts[0].split('-'))
CH=8*1024*1024
a=lo
while a<hi:
d=rd(a,min(CH+64,hi-a))
if not d:
alive=False; break
n=len(d)//4
arr=np.frombuffer(d[:n*4],dtype='<f4')
# vectorized filter on A at even offsets
m=(arr>-60)&(arr<-1)
for i in np.nonzero(m)[0]:
Bv=float(arr[i+1]) if i+1<n else 0
if not (1<Bv<100): continue
addr=a+i*4
s=rd(addr,0x98)
if not s or len(s)<0x98: continue
G=struct.unpack('<f',s[12:16])[0]
if not (0.2<G<8): continue
mode=s[16]
if mode>1: continue
p=struct.unpack('<Q',s[0x90:0x98])[0]
if not (0x10000<p<0x7ffff0000000): continue
key=(round(float(arr[i]),2),round(Bv,2),round(G,3),mode)
if key not in seen:
seen[key]=(addr,p)
print('NEW sub@%x vt=%x A=%.3f B=%.3f G=%.4f mode=%d' %
(addr,p,arr[i],Bv,G,mode), flush=True)
a+=CH
except (FileNotFoundError, ProcessLookupError):
alive=False
break
print('done; unique tuples:', len(seen))
+64
View File
@@ -0,0 +1,64 @@
#!/usr/bin/env python3
"""scan_pairs.py — dump ALL unique adjacent float pairs (A<0<B) seen in rw-mem
during a render window. Diagnostic for LUT param location."""
import struct, subprocess, sys, time
import glob, os
import numpy as np
def find_host():
for p in glob.glob('/proc/[0-9]*'):
pid = int(os.path.basename(p))
try:
cmd = open(f'/proc/{pid}/cmdline','rb').read().replace(b'\0',b' ').decode('utf8','replace')
maps = open(f'/proc/{pid}/maps').read()
except Exception:
continue
if 'soothe2' in maps and 'reaper' not in cmd:
return pid
return None
subprocess.run("pkill -9 -x reaper; pkill -9 -f '[y]abridge'; "
"rm -rf /run/user/1000/yabridge-soothe2_x64-*; sleep 1", shell=True)
rpp = sys.argv[1] if len(sys.argv) > 1 else '/home/m/soothe-bt/dual_b1q_0.5.rpp'
proc = subprocess.Popen(['/usr/bin/reaper','-nosplash','-ignoreerrors','-renderproject', rpp],
stdout=open('/dev/null','w'), stderr=subprocess.STDOUT)
t0=time.time(); host=None
while time.time()-t0<30 and not host:
host = find_host(); time.sleep(0.002)
print('host', host, flush=True)
if not host:
sys.exit(1)
fd = os.open(f'/proc/{host}/mem', os.O_RDONLY)
def rd(a,n):
try: return os.pread(fd,n,a)
except OSError: return None
seen={}
t_end=time.time()+8
while time.time()<t_end:
try:
alive=True
for line in open(f'/proc/{host}/maps'):
parts=line.split()
if 'rw' not in parts[1]: continue
lo,hi=(int(x,16) for x in parts[0].split('-'))
CH=16*1024*1024
a=lo
while a<hi:
d=rd(a,min(CH+64,hi-a))
if not d:
alive=False; break
n=len(d)//8*2
arr=np.frombuffer(d[:n*4],dtype='<f4').reshape(-1,2)
m=(arr[:,0]>-60)&(arr[:,0]<-1)&(arr[:,1]>1)&(arr[:,1]<100)
for i in np.nonzero(m)[0]:
key=(round(float(arr[i,0]),3),round(float(arr[i,1]),3))
if key not in seen:
seen[key]=a+i*8
print('pair A=%.4f B=%.4f @%x' % (key[0],key[1],a+i*8), flush=True)
a+=CH
if not alive: break
except (FileNotFoundError, ProcessLookupError):
break
print('unique pairs:', len(seen))