I've thought hard on where to put this discussion, Development, Mods, Feature Requests, but I've realized that regardless of where I actually put it, it will most likely be moved here, so I might as well save some moderators the trouble.
Following is a thorough description of the feature and the algorithm. I try to explain all aspects as laymen-ly as possible. Try to follow through.
Endgame
The feature's aim is to ensure maximal download with respect to upload in a general(=no assumptions) network.
The idea is, that if download can be controlled using upload, and that upload is controlled by each client to maximize download, then clients that can upload more would be able to download more.
The system itself is designed so that it is controlled by other's upload. If uploaded to, it effects the system's preferences on who to upload to. This creates a form of chain-reaction that eventually leads to the uploaders controlling their own download.
However, the requiremeny of generality makes it so that even if others don't use the system, the most download that can be received from them through selective upload is achieved. In combination with the current CS, this could translate into shaping, but this is the fault of the current CS, not AR.
Advantages
A client's advantage is defined as a weighted sum of future downloads that can be achieved by uploading to that client now.
Note that a client's advantage changes over time.
We define the "state" of the network, as a combination of all of the factors in the network effect transfers, such as clients connected, currently ongoing transfers, corrent queues and status of the credit systems of all clients, downloading and shared files, etc etc, even including the users' state of mind, or even the current weather, since a lightning bolt could potentially cut a download.
Now, there are two factors which change the state of the network. First there's time, since the network is dynamic(as is the weather and the users' state of mind). Second, are uploads and downloads since they effect credit systems and hence effect the actions of clients connected to the network.
We can therefore, from a given state, choose between a selection of future states simply by choosing who to upload to. The issue then becomes, which upload would result in the most desired state?
To examine what is "desired" we first define the value of a future download. If a future download is of X bytes and starts T seconds into the future, than it's value is:
X*(gamma^T)
Where gamma is some constant that is smaller than one.
This means that the same amount of download would have more value if it comes sooner. A download coming in letter has an exponentially lower value. This makes sense, since we would prefer a download now, not in a century.
The reasons for the decrease being exponential rather than inverse-linear are mostly because it makes following equasions simpler.
Now, we define the advantage of a state. From any given state, the future downloads we receive depends on the uploads we make. If we make all the wrong uploads at all the wrong times, we might end up with no download at all. We therefore define the advantage as being the maximal sum of values of future downloads achieveable from the state.
Meaning, the state's advantage is the sum value of future downloads we would get if from that state we would continue to make our uploads optimally.
Now we can finally define the advantage of a client mathematically. The advantage of a client at a given point of time is the advantage of the state that would be reached after uploading to that client, plus the value of the download that would be achieved while making that upload.
Obviously, this means that the higher a client's advantage is, the more desireable it is to upload to that client, in order to get the download, both of getting to that state, and of getting from that state.
Calculating advantages
This is where things get tricky. If you go over the above mathematical definition of advantage, you can't help but notice that a large part of it depends on what happens in a possible future. This is not something you can calculate in a straight-forward manner. Some future-prediction is needed here.
Fortunately, if the above definition of advantage is formed mathematically, it can be reduced to the following equasion which depends only on the current and last network states(and not on all the future ones):
A-U*Prev_Max=D+Max*(gamma^T)-Prev_Max
Where:
A is the sum advantages of the uploads made since the last network state. This is calculated as the advantages of the clients, times the amount of upload made to each one.
U is the total amount of upload done to all clients.
D is the total download received between the last state and the current one.
Prev_Max is the maximal advantage of all clients in the last state.
Max is the maximal advantage of all clients in the current state.
T is the time that passed between the last and current state.
gamma is some constant smaller than one, representing the time-decay of download values.
(Feel free to go over the equasions and verify that the above holds true)
Now the above still doesn't fully offer a method for calculating all advantages, it is a way to incrementally verify if a certain calculation is correct.
From this point, what AR does is try to fit some simple mathematic function, representing the advantages of clients at any given time, to satisfy the above equasion for all of the downloads and uploads measured so far.
It does this, using a "filter".
Filters
Filters are a simple yet effective method for fitting a function to a certain mathematical condition.
In general mathematical form, filters try to solve the following:
There are two given functions, H and F.
X1...Xn are vectors that satisfy:
Xn=H(Xn-1)
Y1...Yn are vectors that are given. The filter must find X1...Xn(given H, it's enough to find one of them), so that Y1...Yn are closest to F(X1)...F(Xn).
"Closest" is defined as "sum(|Yi-F(Xi)|^2)" being minimal.
Here's how filters help calculate advantages:
Suppose we could make a sophisticated simulator that would predict the actions of the network and compute the advantages of all clients. That simulator would only be dependant on it's code and memory. We therefore define the series X1...Xn as the code of the simulator and it's memory at various times. Since we know how code and memory combine, we simply define H as running a cycle of the simulator. H doesn't depend on the simulator itself, only on how a computer is built, so H is given.
Now, we would expect the simulator to fullfil the advantage equasion above. We therefore define F(Xi) as the subtraction of the two sides of the equasion for the result of a given code and memory Xi at the time i. We can calculate F for any code Xi once we have the uploads and downloads of a given cycle. So F is also given.
Note that in a perfect simulator, F(Xi) would be 0 for every i. This is because a perfect simulator would satisfy the above equasion, so the subtraction of the two sides would result in 0. We therefore define Y1...Yn as a series of 0s.
The result is, that by using the filter we find the code and current state-memory for a simulator that should calculate advantages in the most accurate possible way.
(Side note: For those of you being skeptic about whether such a simulator can be found, I should mention similar methods were used to create a simulator that predicted stocks profit opportunities at over 70% success rate. I would think a mostly computer-driven network is not nearly as unpredictable as stocks)
Now the main advantage of filters is that their calculation is ongoing, and they don't need to know the internals of H and F, only to be able to compute them. Just by calculating different Hs and Fs at given times, they can find an optimal X series. This means that you don't have to remember all past downloads and uploads to calculate different values of F, but you can simply calculate as you go.
How do filters work
Filters work in a very simple manner.
Given a value Y1 at a given time, they calculate and store the set of all X1s where F(X1)=Y1(Or, if none exist, the set of closest ones).
Then, when the next Y2 is received, it intersects that set with those that satisfy F(H(X1))=Y2, and then stores the resulting new intersection state-set of X2=H(X1).
This continues, where at time i the filter has all of the possible values of Xi which satisfy all previous measurements, and given a new Yi it reduces it to the smaller set containing only values which are still possible.
Of course, it's impossible to save or intersect an infinite set on computer. Instead filter algorithms reduce the sets to linear or parabolic spaces, which can be stored through a finite set of points within the set, and where intersection is simply projection onto a super-surface.
The difference between F and H to a linear reduction of them is overcome by constantly extending the "possibile values surface" by a small error value in each direction, to represent the values that may have been removed through the linearization.
Also, since only one possibility for Xi can be used for calculating a possibility for the current advantages, the mean(average) of all possible Xi`s is used.
Summary
Using a single recursive formula, AR aims to create a simulator that predicts client advantages, and hence predicts opportunities to get download through upload.
While I did not elaborate on the specific formulas that make out the filter, or the "computer function" H, I think the main point of how AR works is sufficiently understood.
The actual AR source code is available with the rest of SF-IOM, for anyone willing to take a look. Suggestions for improving the filter or the function H would be more than welcome.
If you have any more questions about the system, don't hesitate to ask.