I bound the number of subproblems kept across eight new addresses. How many must I evaluate?
I evict the least recently used entry. I check all eight groups with a rank decoder independent of this eviction policy. I count polynomial evaluations at three capacities. At vertex 16 I go from 18,614 evaluations with 16 entries to 8,272 with 256. I count entries whose byte size can vary.
I will measure bytes and actual stored polynomial lengths. AT.EX21.06 · Try the experiment
Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials
Addressing eight groups on one graph
I look up independent groups of eight vertices containing a required vertex. How many counts can I reuse?
I retain subproblem counts across eight queries. I check each group against its rank in an independent enumeration of the Zachary graph. At vertex 16, subproblem evaluations fall from 6,661 to 1,032. I give the peak entry count and raw timings to distinguish computational savings and memory cost.
I will test a bounded cache on held-out ranks. AT.EX20.06 · Change the inputs.
Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials
Addressing the independent sets of a graph
Require a vertex
How many compatible sets of a given size remain if one vertex is required?
I use the 34 vertices and 78 unweighted edges of Zachary’s graph. Splitting by whether v is absent or present contributes I(G−v) and z I(G−N[v]) to the independence polynomial. The coefficient of zᵏ counts admissible groups. Following branches with nonzero coefficients constructs a group containing v. For each k, summing the conditional counts over vertices must give k times the total.
At size eight, 2,053 of 1,228,103 groups contain vertex 0, while 294,141 contain vertex 16. I recover 13,393,054 groups across all sizes and check small sizes by direct enumeration. I independently check every coefficient using two 17-vertex halves and all 34 size-eight conditional counts by exchanging the halves. Reference values
I use a classical recurrence on public data. An edge is treated as a forbidden pair in this combinatorial exercise. The counts do not predict the club’s behaviour.
Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials
In the field ZIP, I run python experience/stables18.py. The matching JSON file contains the reference output.
Change the parameters · AT.EX18.06
I use the unweighted Zachary graph with 34 vertices and 78 edges. An edge is covered when at least one endpoint is excluded. I recover 13,393,054 independent sets by splitting vertices in half. In the supplied compilation the width-57 order visits 1,982 states versus 151,045 at width 33 in natural order. I use an observed graph for a combinatorial task.
The karate.csv file contains the 78 unweighted edges. Splitting the vertices into two sets of 17 reproduces the compiler’s count. The contrast between width and number of visited states motivates testing constraint selectivity.
After extraction I run python experience/temoin_xiv.py.
Test a reachable-state estimate on other graphs. NetworkX, Zachary’s karate club graph
Width alone does not predict compilation work
Address a group under a vertex constraint
I fix the vertex, exclude its neighbours, and split independent sets by presence of the smallest available vertex. An independence-polynomial coefficient gives the size of the first block. I skip that block or descend into it. Ranks start at zero. I recover 12,913 conditional ranks in order at sizes up to three. I test 1,260 endpoints and 509 empty classes, and compare all 34 size-eight counts with a meet-in-the-middle enumeration.
Change the inputs · AT.EX19.06 · Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials
I reproduce · python stables19.py
Traced bytes across eight group searches
What happens to memory cost when I bound cache entries? I start one interpreter per setting and enable tracemalloc before loading the Zachary graph. I keep eight fixed ranks and check the groups and evaluations against the rank reference. The peak includes setup and queries within traced Python allocations.
At vertex 16 I observe peaks of 1,813,333, 1,491,349 and 1,007,837 bytes at capacities 16, 64 and 256. The nominal entry count alone does not predict these peaks. I will measure temporary recurrence allocations and retained coefficients separately. Change parameters · AT.EX22.06
Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials · Python 3.10 · tracemalloc
Measuring what the cache retains
How much of the peak remains traced after each query when I force Python collection? I measure vertex 16 and eight addresses of the Zachary graph in six fresh interpreters. I reset the peak after setup and after each reading. I check groups and evaluation counts for every capacity.
At 16 entries, the query peak changes from 1,814,657 to 299,929 traced bytes with collection. After the eighth collection, 19,057 traced bytes remain. Throughput and total process memory remain to be measured. I will time collection overhead on the same addresses. Try it · AT.EX23.06
Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials · Python 3.10 · tracemalloc
Measuring collection overhead
How much time does collection between rank queries take? I launch three fresh interpreters per treatment with eight queries at vertex 16. I separately time setup, queries and explicit collector calls. I check all groups and cache miss counts.
At capacity 16 I measure a median of 8.73 ms for eight explicit collections and 112.33 ms for the queries. With automatic collection alone the queries take 111.34 ms. Query times include any automatic collections. I will test collection triggered by a measured memory budget. Change parameters · AT.EX24.06
Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials · Python 3.10 · tracemalloc
Collecting after ranks 2, 4 and 6
What memory and time tradeoff do I measure with three forced collections? I compare automatic-only, selective and systematic collection for eight reads at vertex 16. Three fresh processes time each setting and three others trace allocations. I check groups and cache misses.
At capacity 16 the median peaks are 1,804,009, 552,717 and 292,633 traced bytes, with 131.59, 140.59 and 148.67 ms per query-and-collection sequence. The measurements concern CPython and these ranks. I will retain time, peak and miss count for an external workload. Change parameters · AT.EX25.06
Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials · Python 3.10 · tracemalloc
Predicting memory between collections
With three scheduled collections, how far do I underestimate peak memory? I predict peaks by rank from previously measured increments and reset levels. I compare them with the median of three fresh traced processes and time three separate processes.
Across eight reads the mean absolute error is 11,061 bytes at capacity 64 and 9,170 bytes at capacity 256. Errors start after the first collection. I will measure live allocations immediately after collection. Change parameters · AT.EX26.06
Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials · Python 3.10 · tracemalloc
Live bytes after collection
Can I predict the next peak better by measuring live memory? I combine measured live bytes after reads 2,4,6 with the previously observed peak increment under automatic collection. I test three fresh processes per capacity.
The correction slightly increases median error in all six comparisons. Each peak is still underestimated by over 12,000 bytes. I will test whether temporary allocations during the query explain the error. Change parameters · AT.EX27.06
Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials · Python 3.10 · tracemalloc
Predicting the peak on a held-out read
Does a correction learned on two reads help size the next one? I measure current peak minus live bytes at the previous read. I compare medians from three processes per collection mode and capacity. I calibrate on reads 3 and 5.
On held-out read 7, signed error falls from 15,336 to 712 bytes at capacity 64 and from 12,320 to −28 bytes at capacity 256. I restrict this estimate to the traced benchmark. I will reserve a new access profile to test transfer. Change parameters · AT.EX28.06
Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials · Python 3.10 · tracemalloc
Transferring a memory correction to a reversed traversal
I keep the correction learned on the first profile. What does it predict if I reverse the rank order? I freeze corrections of 14,624 and 12,348 bytes and measure two collection modes in three fresh processes per capacity and mode. I check each decoded group against its expected group.
On reads 3,5,7 my corrected errors are +648,+648,−752 bytes at capacity 64 and +148,+292,+452 at capacity 256. I retain the raw increments for checking transfer. I will hold out a nonmonotone ordering of ranks. Change parameters · AT.EX29.06
Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials · Python 3.10 · tracemalloc
Measuring memory in an interleaved order
I freeze the previous memory corrections and interleave the ranks. How large is the residual error? I visit eight indices in order 0,7,1,6,2,5,3,4 in three processes per mode, then compare median increments at reads 3,5,7. I check the combinatorial answer at every read.
I measure corrected errors from −840 to +712 bytes at capacity 64 and from −28 to +452 at capacity 256. These are observations of the local runtime. I will reserve a different runtime to test transfer of the corrections. Change parameters · AT.EX30.06
Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials · Python 3.10 · tracemalloc
Testing a memory correction on a second Python
Can I carry a correction measured on one Python installation to another? I retain capacities, read order and the historical corrections. I measure the memory increments in subprocesses of the second interpreter.
On the six held-out reads I find corrected errors from −11,752 to −9,964 bytes in the 3.11.7 session. The calibration from the first installation consistently exceeds the new gap. I will split the gap into structural and payload allocations at a fixed capacity. Change parameters · AT.EX31.06
Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials · Python 3.10 · tracemalloc
Separating retained allocations
How much retained memory can I attribute to coefficient construction or to cache call sites? I take a tracemalloc snapshot in separate processes after a held-out read. I group retained blocks by source line. I compare explicit and automatic collection with equal cache miss counts.
Across six comparisons, cache call sites and coefficient construction produce gaps of the same sign. These retained bytes and their source-line attribution leave transient peak allocations unmeasured. I will locate the maximum inside a query to relate snapshots to peaks. Change parameters · AT.EX32.06
Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials · Python 3.10 · tracemalloc
When does memory reach its high-water mark?
I observe the memory high-water mark after each cache return within a rank query. I record the cumulative tracemalloc peak and compare it with the final reading on the same run. A separate run measures the peak with no inner probes. The probes keep their observations in memory.
In all 32 published instrumented reads the final peak is already visible inside the loop. I isolate the first return where this maximum becomes visible. The precise allocating instruction and the uninstrumented peak remain separate measurements. I will measure probe disturbance with a fixed-size buffer and separate processes. Change parameters · AT.EX33.06
Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials · Python 3.10 · tracemalloc
Historical results — A25 · Frontier width bounds the number of coverage states, A30 · Reordering modules in a frontier computation, A33 · Width alone does not predict compilation work