Repository navigation
Conversation
Something something that hack above
Sometimes my first-pass writing makes me wonder after I get away from it for long enough.
drives me nuts when I find these old signatures. Subconsciously probably been avoiding test writing because I can't stand the with_context macro lol
Committing this file so we can record some final fixups with blame. About to do some trimming of near-zero aprons and add some sanity checks.
The comment indicated that the threshold should be less than or equal to PI/c. Well, PI/c is equal to PI/c. Runtime cuts quite a bit, from 200ms to about 60ms. du being the grid control parameter, this seems to control the sampling of the mother wavelet before it is applied to genrate our daughter wavelets.
A more principled approach will focus on the resulting eps. The summation of a window applied to input will be used to tune this to a degree of no consequence.
This is moving way too fast, but we'll come back when it breaks 🤡 Key questions I tried to - Do the two transform methods agree with each other? - Are either of the transforms correct? - Is the resulting wavelet useful? - Do we understand how to use this in a spectrogram? - Do we understand what we traded for with key choices? Okay, now time to go see if this breaks. It's really irritating knowing that the anti-code-generation crowd wants the wavelet library to be poured over by hand without ever putting the fucking thing on screen to just SEE the smoke and then start triangulating what / how to improve when there's something to motivate and prioritize... It's completely backwards and of course demanded by little birds chirping in the nest. Absolute imbeciles. The worst part is that these idiots know nothing about getting to problems early in order to minimize risk and accelerate the delivery of virtually everything else they ever WILL want. Faster fucking horses. Go to hell.
We need to generate filters. The filters are very similar up to the decimation level, so the new API focuses on scaling a single design by the decimation factor. the definitions of the guard bands still makes me want to reach for some actual design tool that is main lobe aware, but that depends on the filter banks. In practice, we will have to calibrate after reassignment to level out the gaps where a side lobe is obliterated by the ripple instead of properly attributed. - introduced --terminal option and an early pass band solver band that can support more ripple when nobody is reading that region. - CLI args changed to reflect emphasis on useful region of the new Nyquist post-decimation. - Got rid of the estimator that had proven not useful anyway due to our maximal transition strategy. - Printout is in dB - RMS energy rather than peak scan. Careful. Post-fold, the RMS does not go up, but the location can change, and noise + noise = 2x noise. Well, if we're lucky, an LLM is going to read this. Good day!
We need the pass bands exposed in order to select a downsampling rate. First step is a struct to hang the settings off of.. and next it would be good to define a filter group to just give it an f-center and sample rate and assign the right downsampling rate index. Also these weights are generally quite a bit better behaved. The transition is more attenuated overall and the stop band hits harder. Delay is less. Added yet unused 16x downsampling weights while seeing if it would keep working by just continuing the same delay pattern.
10/10/10/10 Can't wait for some rejects who type with two fingers to see the commented literal values in my weights module and presume that none of the decimal values match binary without ever reading a goddamned line of the PMR tool that generated them and then, from the depths of their smelly basements, convene in a mass of stupidity to successfully "identify" the center of the center of all slop. There is a lot of laziness in the AI era, and far too much of it comes from those who can't be left behind soon enough. How do I know of these CHUDs and their basements? "I can tell." 😼
Requires a lane mask.. I don't think divergent, instead just constraining to lanes that will participate in actually writing an output. I didn't like that we were reading from data ahead of the read head. We would not output the results... but why read it? Nothing good can ever come of such a read, so if the mask doesn't diverge, we should not read it.
Wanted to push this behavior up into the abstraction real quick. The part where coherent memory doesn't need flushing will later subsume it.
* Old crimes: - giving an address to the downstream for it to store in its control data. Push constants are the right way. Otherwise the runtime can't dual-write swap the address out to compact memory use. - `CHANNELS`. Why would this be static? - `channel_offsets` might make sense if the memory is not laid out right there - Doing client math to.... decide the fucking dispatch geometry before we even know how the shader works? WTF is that? * As a consequence of un-criming these crimes: - DeviceRingView goes away - DeviceAudioView, an actually good name, uses a single device address + channel count + sample count to tell shaders downstream where to find their input - Nobody can even ask to see the allocation until they are doing something in the ImportSink callback, so we can potentially give that callback to someone else with a new audio source... - A bunch of stupid methods gone from the consumer A whole lot of shitty comments and things went away... A whole lot of imprecise wording and early ideas went away. * NOW FOR THE PROSPERITY: - Write more code - The motivation for un-criming this module AND THE GUIDING LIGHTS THAT MADE IT CLEAR WHAT NEEDED TO HAPPEN ...All came from writing more code. It was writing the shaders that made me appreciate the simplicity of certain dispatch geometry, wrapping math, and ways of representing the location, geometry, and state of the data with just a few u32s. That was what made it clear how much of the current module, which was very easy to pare down, needed to die. This module was bad. Now it is a lot less bad. So don't be a pussy. Nothing against pussies, but my god, we've been telling people for TWENTY FUCKING YEARS that you will figure things out faster only by **getting to the motivating problems faster**. The only people who want "clean code" want other people to do everything for them and then to show up, read some library examples, copy some stack overfLLM, and collect a check. They cannot write the code they profess to want, to admire. They can upvote it. They can download it. They can talk about how good it is and how they're a good person who has good coding moral habits. YET THEY STILL CANNOT MAKE IT AND DO NOT KNOW WHERE IT COMES FROM. They just "know" that's what they want. It is important for Open Source to be high quality, higher than most commercial code, if the Open Source strategy is going to work. Nonetheless, always remember, programmers day in and day out wade through the tail waters of Chernobyl beating alligators to death bare-handed and feeding them to mutated piranhas to clear a path through lousy code, which is most commercial code, code they are paid not to moralize about. We can do it. We will do it. We need only the motivation, and motivation comes from something WORKING. Something that consumers and businesses WANT. Get to the **motivating problems** because that is what pulls things along at the highest rate per unit of time input. So just write code 👍
You'll never believe it... the data was already there.
follow up to 995c17c - switch old RingLayout type in the callback to new DeviceAudioView - get rid of split allocation / instantiation
|
Planning out the work leveling on the GPU.
Going to do some overlap ratio math to see how the multiple frames of the short bins per audio server tick turns into extra work at that scale. Sleepy. With bin load in hand, we an level the work across the device. Don't know how it will go, but the device is going to walk all over this workload if I do it right. |
Headroom
The PMR tool needs a configuration option for allowing strong ripple, but not amplification, in the low parts of the pass band so that we can hit our targets with a shorter transition. Delay...That 657ms delay on the 20Hz will be slightly aided by reassigned energies from faster bins as long as they can see 20Hz. But the problem always remains. We can't see a full extrema within one frame. We can't see a full cycle in under three frames at 60Hz. The energy will hit middle-of-window in half of 1971 taps, 1000 taps on a 3kHz signal is less than stellar. An auxiliary window that is the minimum required for the main lobe to reject the next image is about the only tool left in the box. We have to trade worse pitch for better time resolution and then use more cross-correlation between related bins to recover pitch and amplitude. Late corrections from longer Qs won't be instantaneously available. I'm going to clean up the tests (throwing them in integration tests) and try to implement the current state of things with some minor tweaks from these estimates. |
It would be nice to decide on a common header pattern for consuming outputs, GPU driven or host driven styles of consumption. Downstream might want GPU driven style: - give us one pointer and a Slang library to unpack the header. Downstram might want smart host style: - pack up and re-marshal a big pile of shit The GPU driven style is more convenient, but we have to pile-of-shit-before we can run.
I am throwing this into history. Scrutiny may follow.
f14733a to
36eaade
Compare
52bf690 to
15dc60e
Compare
Highly generated. Looked at waves. They are truncated and tapered. Tests demonstrate some expected loss of fidelity. The halo testing is wildly insufficient. Let's see it on the screen before we clutch our pearls amirite?
This feels very not done, but I feel very tired. There is a Teeth that doesn't belong to a Comb and a lot of this feels like duplication going in the wrong direction, but it does fix the basic problem with floor being some clueless scan of some arbitrary octaves, making the whole thing very rho dependent. Truncation test regains the assert, and that is the correctness. Skirt test is also a lot less garbage, but that is next for some updating.
r_hat_chirp test indicates this is the best before low Q begins degrading
It's the law. Always use these semantics. Taps are the filter points in a complete hop, which is never folded. Weights are physical in memory.
Looks like using the mirror as a fallback and probably silently failing. Anyway, well behaved so far.
was working on something else that won't be delivered, but it does make sense to have.
The sharper taper really do deliver on many tests, but as we get to very short filters, a failure shows up. Super low knee values are a bit dangerous. Gamma = 2.0 has a slight bobble at very specific `u`, but IIRC the fallback just makes this a bump. Lower gamma has a virtue for filter **banks** that is being explored. Other stuff, just tired of looking at the uncommitted settings.
This was just a short gadget made while exploring banks, not individual filters.
bb18bd0 to
57ff20a
Compare
- Grid now carries wavelet's Shape - Taper uses analytic slope estimate beyond ANALYTIC_DB, -120dB, avoiding the region where oscillations begin. - All Tapers clamp to F32_MIN_CLIFF to avoid tapering what the sum on the device can't see anyway. This preserves body in cases where, for example, the Cylinder taper would core the algebraic tail almost completely and only make the filter worse overall. - If the ANALYTIC_DB is set too low, we get a warning and a fallback whenever slope is reversed, meaning we're not falling back early enough. Fixes non-finite weights detected by debug_assert in `Bin::write`.
The clamps were a bit off. Curvature oscillation also begins sooner than expected, and the analytic result is yielding a more consistent spectrum.
- the floor is now always the antipode, within some reasonable radius. provides a consistent surrogate signal for roll-off, floor curvature, etc. Any floors in the positive spectrum are unreliable if they are forced to land somewhere on a wide skirt, making the floor readings depend on Q and truncation, exactly not what we ever wanted - PSL now reads dips, skips very minor dips, and can walk out of a well near the main lobe for cases similar to the ultraspherical, which absolutely happen when looking at large numbers of test points. - overall inspection and harness code was simplified incidentally. - Skirt test rework now quite a bit more useful. about to integrate PSL into our primary metrics. Along with the antipode floor, PSL gives us a very strong idea about how much dynamic range we have available.
got rid of the arbitrary dB floor and did energy-distance / energy, which yields a real calculation that can, like SNR, feel pretty dB-ish.. while truly being dB-ish. Center frequency was chosen as the "distance" normalizer, so dB values compare different filters well.
This commit is basically a draft of the future™, not a very complete version.
Tests exist, but they are development tests and will not be committed yet.
Q goes up proportionate to 1/N
Q-effective goes up proportionate to N^{-3/2}
If increase the filter length to Q = 8, we need 8x the filter length. The same
taps buy 22.6x the Q-effective. The faster growth in pitch precision is quite
welcome, especially for lower pitches.
A future consequence will be lower Q even in "constant Q" style bank arrangment.
Our existing APIs were going to struggle to answer how high Q must be and how low the PSL of a filter must be. A Calibration structure will cut a few mother wavelets at different Q, using one set of Restriction and Refinement etc, and then cut a bunch of wavelets. From the wavelets, it creates a rough map that can then predict the settings needed to different kinds of goals. We build up our PSL estimation in order to support calibration. PSL, fold, and floor are some of the more essential and accurate results. Some older pieces of APIs like `from_noise_floor` etc are going to fall behind for a bit. While creating the filter bank, the new workflows will be figured out.
|
Back to not building for viz. Created a calibration thing to enable predicting the filter settings necessary for each bin instead guess-and-check style post-calibration. The new Q-effective treatment is going to be super valuable for reducing the required size of lower pitch bins. Seems like the final push has taken shape. Once the CQT is delivered, the clouds will part and the white wolf will return from the celestial plain. |
The old "kappa" was just some bullshit before I had the bright idea of adding up the response energy * main lobe distance. Showing two-sided E * dB better serves the role of showing us the skew in the skirt. E * dB is our primary tool for qualifying main lobe shapes. If E * dB goes up, we know we have more energy mass outside the target main lobe. The measure is robust against weird pre-PSL shapes, meaning it filters dippy shoulders well. A real bump however will light up like a Christmas tree. Dropped some columns I wasn't interested in reading, including "kappa".
The `WaveletSpec` is not something that answers questions like a `Bin`. We use `with_*` on `Bin` because the `Bin` API is primarily for querying but supports mutation. `WaveletSpec` is mostly pure mutation.
Code generator-san confused the ideas. We're going to rename to q_reassign or q_r for short elsewhere because q_eff is kind of ambiguous with q_real. - q_r: effective resolution with reassignment factored in - q_real: realized q, after truncation and everything. deep enough truncation eats into the filter body and causes the bandwidth to go up.
Executive summary: - tail modeling in `Shape` uses much more accurate approximation, similar to `QuadJet` - restriction uses improved model from `Shape`. - Taper responds to tail oscillation, obtaining about -10dB and removing spectrum combs in the skirt and floor! - `from_noise_floor` and `noise_floor_is_delivered` gone. - `truncation_is_predictable` is a rough implementation of the new `Calibration` bin request API to be delivered next The first goal of calibration was to support an API for requesting bins based on PSL, which can be interpreted as the useful dynamic range. An old problem, the medium-ish quality of the `tail_db` approximation, emerged as a central hurdle. Use of the same approximation in a restriction gate became entangled. A fairly convoluted narrative developed... - Improving the analytic model for tail truncation turned out to be quite feasible. QuadJet itself contains approximations of QuadJet in the form of the saddle expansion. These are generally not bad and much better than the Guassian + algebraic tail model they replace at the cost of some complexity. - The tapering in the restriction module was using a separate, also shitty analytic tail model to avoid the ripple at large u. The *gate* for this behavior causes floor oscillations and was screwing with the calibration, which can adapt to one shitty model but a shitty model and an empirical result from QuadJet that were arbitrarily gated. - While making the taper re-use the improved model through `Shape`, it was realized that *the tail ripple was not being accounted for when applying tapers!* If we core a cylinder out of a rippling tail, we're making it oscillate at a *higher* relative amplitude! So this was fixed incidentally at the cost of being an unreadable commit. - The old `from_noise_floor` API was dropped to make way for replacement with a PSL based API on the `Calibration`. - Tests such as `noise_floor_is_delivered` were removed - A very basic, very rough draft of requesting a filter via PSL from `Calibration` as bolted onto the `truncation_is_predictable` test, which had already been augmented to report PSL, so the whole change was delivered together. Adun Toridas
Testing showed zero effects down to much lower grid resolution. Improves baking speeds. Quadrature tends to random-walk the unbiased error, so precision doesn't really wander that far at lower grid spacings.
see mod comments and let u/Wb9VBScxu2uZJHeq2E3W observe that as long as some write the commits while others talk about hypothetical virtues with abstract benefits, the talkers can live in infamy.
Couldn't deny the `r_hat` tests looked a bit better. Everything else looked fine. Just going with them until better testing / spectral tuning is available. In particular, the refinment nulls are not mirrored with these settings. Not sure what that's about. Might have changed something else.
probably just get rid of it and associated gate. for now, this prevents a random jump in the floor behavior that calibration was very capable of seeing and then trying to fit and making the fit look less good... applying the tapers in a ripple-accommodating manner was by far the bigger win since it meant dips in the ripple weren't being almost zeroed. there are other options. too tired to write them out coherently. but there is another.
- bins no longer add an arbitrary extra tap. this made the math more consistent and consequently calibration tightened up - calibration's printout was drastically overhauled for readability after figuring out what values could be useful - load quantum is in the calibration matrix - how some values are scored was updated for the (not load quantum) N tap quantization of resolved u. - calibration was re-organized around PSL requests since it behaves better and consequently makes all other calibration land better Just read the calibration output and be much more pleased with this second-ish pass.
|
Remaining work between me in the shader writing is mostly about filter bank planning. I'm exploiting some effects where the effective pitch resolution scales as N^{-3/2} instead of N. The Q and truncation calibration work feed that work. Measuring the effective pitch resolution is also the decider for "What is a good filter setting?" Did the planning tonight. The the DC main lobe compression, chord deconfusion, and high pitch avoidance of noise floor and Nyquist fold of the skirt are among three known problems that need some engineering to pick the right length, shape, and truncation for each filter. Testing focused on transient response has greatly increased the capability to evaluate changes where it will matter the most. Developing the pitch precision calibration will provide another layer that starts telling us where spectral tuning wins can be had. |
|
I've been working on the gather implementation. Projecting the sound onto the 4k little filters is the scatter. The gather is where the output goes to the bins. The Feature-biased models were developed to learn things, techniques. A feature-neutral model is useful because, while a feature-biased model may "sharpen" better, it will introduce artifacts and lies in various real world circumstances. A feature-unbiased model has the variance conserved honestly (bias variance tradeoff) and sharpens what can be honestly sharpened. After I get the mass conservation level, we will probably have one of the better tools on the planet. The fundamentals just don't support making inferences beyond a certain degree. References implementations included to evidence claims. |
Deep into the bias vs variance tradeoffs. More places to do work, but also getting past time to de-risk the shader implementation. Satisfied that I know what could be done if we wanted to go farther at extracting the unbiased signal. |
This PR represents the work to replace the DFT with a CWT and some extra tweaks to get to a viable 2026 spectrogram. The goal is about 1% GPU usage, full screen, 70dB dynamic range, 4k resolution. Adun Toridas.