"""Constructed page/object cost model; no hardware benchmark.""" import json,math SLUG="disaggregated-memory-paths" def run(): size,page,bw,lat,hook=64,4096,20000,2.0,.1 ks=list(range(1,65)) pagecost=lambda k:lat+page/bw+.01*k objcost=lambda k:k*(lat+size/bw+hook) cross=next(k for k in ks if pagecost(k)<=objcost(k)) assert cross==2 assert abs(pagecost(64)/64-.04445)<1e-10 assert abs(objcost(1)-2.1032)<1e-10 qs=[1,2,4,8,16,32,64,128] rates=[min(q/(lat+page/bw),bw/page) for q in qs] assert rates[-1]==bw/page and all(a<=b for a,b in zip(rates,rates[1:])) assert math.ceil((lat+page/bw)*bw/page)==11 return {"slug":SLUG,"checks":[{"name":"Independent byte-to-time conversion and sparse/dense witnesses","passed":True,"cases":3,"detail":"64-byte object; 4096-byte page; 20000 bytes/us. Page policy wins from k=2 in this deliberately serial model."},{"name":"Concurrency envelope monotonicity and bandwidth cap","passed":True,"cases":8,"detail":"11 outstanding page transfers are needed to reach the ideal bandwidth envelope."}], "figures":[{"id":"granularity","title":"Locality changes the cheaper transfer unit","x_label":"Useful 64-byte objects per fetched page","y_label":"Amortized microseconds per useful object","series":[{"name":"Page fetch plus local access","x":ks,"y":[pagecost(k)/k for k in ks]},{"name":"Serial object fetches","x":ks,"y":[objcost(k)/k for k in ks]}],"caption":"A constructed serialized access model. The page and object policies do not share an equal CPU overhead. No retries, overlap, prefetch or eviction costs are included.","assumptions":["2 us fixed remote cost; 20 GB/s transfer bandwidth","Page is 4096 bytes; object 64 bytes","Object bookkeeping 0.1 us; local access 0.01 us"],"kind":"Constructed analytical model; not a measured benchmark"},{"id":"concurrency","title":"Concurrency hides latency only until bandwidth saturates","x_label":"Outstanding 4096-byte transfers","y_label":"Million page transfers per second","series":[{"name":"Ideal concurrency/bandwidth envelope","x":qs,"y":rates}],"caption":"Outstanding transfers divided by latency are capped by transfer bandwidth. This is an upper envelope, not a queueing or NIC contention prediction.","assumptions":["Independent requests with equal size","Fixed unloaded transfer latency; no CPU bottleneck"],"kind":"Constructed analytical model; not a measured benchmark"}], "result_summary":{"page_us_k1":pagecost(1),"object_us_k1":objcost(1),"crossover_useful_objects":cross,"page_amortized_us_k64":pagecost(64)/64,"bandwidth_cap_million_pages_per_s":bw/page,"minimum_outstanding_at_cap":11}} if __name__=="__main__":print(json.dumps(run(),indent=2))