text:
As close to flat as possible
Write a program or function that fulfills the following

Scores less than 101 bytes under normal code-golf rules
Takes no input1 and always outputs a single integer.
Every integer is a possible output.

Your score will be the probability of the most frequent integer occurring, with a lower scoring being the goal.  That is \$\mathrm{sup}\left\{P(x)|x\in\mathbb{Z}\right\}\$.
Since a few of these properties are not program decidable, you should be ready to provide a proof that your answer is valid and obtains the score it claims.

1 You may optionally take a stream of random bits, or a subroutine which produces random bits on each call as an input to provide randomness.  Each bit will be uniform and independent of other bits.

Python 3, score \$\approx \frac{1}{\sqrt{8\pi\lambda}}\$ where \$\lambda \approx 9\uparrow\uparrow (9\uparrow \uparrow (9 \uparrow \uparrow (9 \uparrow \uparrow (9\uparrow\uparrow 9)))))\$
This is g(9), approximately 10^(10^(10^(10^(10^(10^(10^8.567841344463464)))))); I'm doing g(g(g(g(g(9))))) to get the \$\lambda\$ above.
\$a \uparrow b\$ (Knuth's up-arrow notation) is a to the power of b. \$a \uparrow\uparrow b\$ is a to the power of itself, b times. So \$9\uparrow\uparrow 3 = 9^{9^9}\$ and \$9\uparrow\uparrow 9 = 9^{9^{9^{9^{9^{9^{9^{9^{9}}}}}}}}\$
from numpy.random import*
g=lambda n:n and 9**g(n-1)
print(choice([-1,1])*poisson(g(g(g(g(g(9)))))))

DON'T Try it online! Blows the recursion limit, of course.
How it works:
The Poisson distribution is a random distribution that, by itself, already generates random positive integers from 0 to infinity. This distribution takes a parameter, \$\lambda \$, that affects how likely the smaller integers are. What we have to do is set \$\lambda\$ in such a way that small numbers become very unlikely.
Then we use the wiki page again to realize the mode of the distribution is related to its parameter and then we plug the mode into the probability density function to get the program's score. After that we use Sterling's approximation to simplify the expression to something that is only slightly more digestible.
If I really can't waive the recursion limit then a similar approach with a loop gives
Python 2, score \$\approx \frac{1}{\sqrt{8\pi\lambda}}\$ where \$\lambda = 9\uparrow\uparrow (9 \uparrow\uparrow 7)\$
from numpy.random import*
print(choice([-1,1])*poisson(eval('**'.join(`9`*9**9**9**9**9**9**9**9))))

Don't try it online! Got some more bigness because @xnor taught me how join works when used directly on strings.

You could add another 9 as your code-golf score is only 99.

Why would this still crash given unlimited RAM and time?

Because python defaults to a recursion limit of 1000 and you have to set the recursion limit to be higher in the program if you want it to be @RGS

Because Python imposes a hard limit on recursion depth, regardless of RAM. You can override it with sys.setrecursionlimit.

@Grimmy I believe we may assume recursion limits can be set arbitrarily high unless otherwise dictated. I see nothing concrete on meta at a quick glance.

@JonathanAllan ah if that is true, then I may revert my edit... Who is "right", then? Because this new version is definitely not as impressive

I've written plenty of answers in Python that hit the default recursion limit. Usually this is once input gets large enough. Here we take no input, but answers to this question cannot complete in reality as we know it anyway, so I can't see what's extra special about a recursion limit, over say time or space. If people feel there needs to be clarification then head to meta. I'm using recursion in my Jelly answer too and Jelly does sys.setrecursionlimit(1 << 30) so it would come under the same ruling; I don't feel one should write an interpreter in another language just to avoid this.

...actually looping gained me a byte to use in the end.

@JonathanAllan thanks for your PoV. At this point, my iterative solution is almost as competitive as the recursive one, but the recursive still has more 9s

Nvm, just abused recursion again

My experience has been that's its standard in Python golfing here to ignore the recursion limit as a machine limit like memory.

@xnor thanks for your sharing your experience here, in particular because it helps me out :D do you have any idea how we could compare the couple of answers that we have right now?

I'll leave it to the Gooolologists to compare them :) It looks like your iterative solution can squeeze out some more bigness by just joining a string directly '**'.join("9"*stuff), which should give you some room to make the stuff bigger, maybe enough to beat your recursive solution.

Looking at the numpy random library, there's options similar to Poisson that would save you from having to generate the sign yourself. Like, I think normal()*BIG has the right property except it gives non-integers, which can be fixed with normal()*BIG//1. And randn is same as normal but shorter. An ideal thing would be like Poisson but including negatives. There might be something like that in the list.

@xnor had no idea join worked like that on strings, made the stuff bigger already. But this still doesn't beat the recursive solution, the power tower isn't big enough. As to the sign generation, I'll have a look ASAP.

05AB1E, score 0.5 / 1000!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
bug fix thanks to FryAmTheEggman
+1 ! thanks to ExpiredData
 [₄!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!LΩ#¼]¾D±)Ω

(dont't) Try it online! (will timeout).
Try it online without the factorials
[           ]            # loop:
 ₄                       #  1000
  !!...!                 #  take the factorial, 88 times
        LΩ               #  pick a random number from 1 to that many
          #              #  if the number was 1, exit the loop
           ¼             #  increment counter_variable
             ¾           # after the loop: push counter_variable
              D±         # push its bitwise negation
                )        # wrap the two in a list
                 Ω       # pick a random element of that list

Any integer would work instead of 1000!!...!, so this approach could score as low as 0.5 / BB(89), where BB is 05AB1E's Busy Beaver function.

Sorry, from your explanation I failed to understand how your program can generate arbitrarily large numbers.

@RGS Think "number of consecutive heads until you get tails". This can be 0, but it can also be arbitrarily large if you get a lot of heads in a row. This is the same, but instead of flipping a 2-sided coin, we flip a 1000!!!... sided dice (and only stop on 1, so that 0, the most likely number, has probability 1/1000!!!...).

@ExpiredData indeed, that saves one byte.

@FryAmTheEggman that's a bug in legacy 05AB1E, i switched to modern 05AB1E to work around it.

@Grimmy starting to think a construction like ∞₄ùJ will grow faster but I'm not sure.. or even just ₄LJLJLJLJLJLJ...

@ExpiredData ₄LJ is barely bigger than ₄!, so it's definitely way smaller than ₄!! (which is the fair comparison, since LJ takes up two bytes). ùJ is better than LJ, but still not nearly as good as !!.

@Grimmy is it enough to say that g^2(x) > f(x) for some x therefore g^n(x) is always greater than f^(n/2)(x)

One additional ! by using 1µ₄LΩ}N instead of [₄LΩ#¼]¾

what would happen if you'll try to index that into λ₁₁m}?

or λžJ₁mLJ}, and it also might be possible to duplicate/triplicate it and then index the output to it again

something like λžJ₁m}©₄èƒ®sè}ƒ®sè}ƒ®sè}ƒ®sè}ƒ®sè}ƒ®sè}ƒ®sè}ƒ®sè}ƒ®sè}ƒ®sè}ƒ®sè}ƒ®sè}ƒ®sè}ƒ®sè}ƒ®sè}ƒ®sè}

in fact you can probably put them inside eachother like λžJ₁m}©₄èƒ®sèƒ®sèƒ®sèƒ®sèƒ®sèƒ®sèƒ®sèƒ®sèƒ®sèƒ®sèƒ®sèƒ®sèƒ®sèƒ®sèƒ®sèƒ®sè}}}}}}}}}}}}}}}}

Jelly, 1 / 2M ?*,
* Any help scoring this appreciated, 0 and -1 are the two equally most likely answers at \$\frac{1}{2M}\$ - see code breakdown.
Inspiration taken from Grimmy's 05AB1E answer.
‘ɼµ⁹!!!!;”!ẋ$VƊ;”!ẋ$VƊ;”!ẋ$VƊ;”!ẋ$VƊ;”!ẋ$VƊ;”!ẋ$VƊ;”!ẋ$VƊ;”!ẋ$VƊ;”!ẋ$VƊ;”!ẋ$VƊ;”!ẋ$VƊ;”!ẋ$VƊX’µ¿~2X¤¡

No point trying this online!
Try incrementing with 4 increment tetrations (with incrementing the self-referential tetration is just doubling, also start with 2 rather than 256 so n=(2+1+1+1+1)*2*2*2*2=96, much more likely to terminate)
How?
‘ɼµ⁹!!!!;”!ẋ$VƊ;”!ẋ$VƊ ... X’µ¿~2X¤¡ - Link, no arguments
                              ¿      - while...
  µ                          µ       - ...condition: monadic chain (f(0)):
   ⁹                                 -     256
    !                                -     factorial = 256*255*...*1 = a
     !                               -     factorial = a*(a-1)*...*1 = b
      !                              -     factorial = b*(b-1)*...*1 = c
       !                             -     factorial = c*(c-1)*...*1 = A
              Ɗ                      -     last three links as a monad:
            $                        -       last two links as a monad:
         ”!                          -         literal '!' character
           ẋ                         -         repeated A times
        ;                            -       concatenate to A -> number A with A '!' after it
             V                       -       evaluate as Jelly code -> A!!..! * (A!!..!-1) * ... * 1
               ;”!ẋ$VƊ               -     call that B and repeat that process
                       ...           -     repeat 10 more times giving us M
                           X         -     choose a random integer in [1..M] inclusive
                            ’        -     decrement (i.e. while random choice != 1)
                                   ¡ - repeat...
                                  ¤  - ...number of times:
                                2    -   two
                                 X   -   random integer in [1,2] inclusive
                               ~     - ...action: bitwise NOT

What is M here?

See the code breakdown - I don't know how to measure it - take $A=256!!!$ and apply factorial $A$ times to $A$ to yield $B$, now apply factorial $B$ times to $B$ to yield $C$ ... etc. to yield $M$.

C (gcc), 99 bytes
f(b,t)long b(),t;{for(b()/4503599627370496&&printf("-");t-9007199254740992;t=b())putchar(t%10+48);}

b is a function returning 52 random bits in the form of an integer in the range of [0, 9007199254740992).
Try it online!

Yup, this looks valid now. As far as I can tell, the most likely output is now 0, with probability 1/112, so that's your score.

You can improve this to 1/230, if you take a full byte from your random function.  Try it online!

@PostRockGarfHunter I can improve it a lot more if I take numbers in a range of [0, -LONG_MIN/4) assuming LONG_MIN/4 % 10 == -2.

@Post Also, that 8 is intentionally (15+1)/2, so the probability of the number being positive or negative is equal.

Pyth, score of the order \$f_{\varphi(\omega,0)+1}(10^{10^{64}})^{-1}\$
M,-.<hG@H1.<hH@G1+@G1@H1D%ZYI<hZ0R,_hZ@Z1J,1 0V.<1Y=J%gZJY)R,hJ+@J1YVC*GCG=T@%TT1)K0WOT=+K1)IO2K.?_K

Don't try it online!
Pyth, score of the order \$f_{\varphi(\omega,0)+\omega}(4)^{-1}\$
(More precisely around \$f_{\varphi(\omega,0)+4}(10)^{-1}\$)
M,-.<hG@H1.<hH@G1+@G1@H1D%dYI<hd0R,_hd@d1J,1 0V.<1Y=J%gdJY)R,hJ+@J1YVTVTVTVT=T@%TT1;WOT=+Z1)IO2Z.?_Z

Don't try it online!
Original python, but in the Pyth I made changes to increase size:
import random
g=lambda G,H:(G[0]<<H[1]-H[0]<<G[1],G[1]+H[1])
def C(Z,Y):
  if Z[0]<0: return -Z[0],Z[1]
  J=(1,0)
  for N in range(1<<Y):J=C(g(Z,J))
  return J[0],J[1]+Y
T=10
for N in range(T): T=C(T,T)[1]
K=0
while random.randint(0,T):
  K+=1
if random.randint(0,1):
  print(K)
else:
  print(-K)

Explanation
This uses the extremely fast growing functions \$M_n\$ defined here. They're actually my go-to when I need fast-growing functions, since they have a growth rate approaching \$\varphi(\omega,0)\$ and are simple to implement. Since they operate on fractions, I use the representation \$(a,b)=\frac{a}{2^b}\$. I iterate the operation \$n\mapsto M_{2^n}(n)\$ starting from 10 roughly \$10^{10^{64}}\$ times, then output integers in a geometric distribution with parameter \$\frac{1}{n}\$, with signs attached. Thus, the score is \$\frac{1}{n}\$. Yes, you can slightly improve it, but it's so big your improvements are negligible.
Yes, this absolutely dominates every other entry so far.

can we have link to test online :-)

Charcoal, 26 bytes, score 0.0005
Ｗ‽φ⊞υωＩ⎇‽²Ｌυ±⊕Ｌυ

Try it online! Link is to verbose version of code. 0 and -1 have probabilities of 0.0005, then each subsequent integer has a probability 0.999 times that of the previous. Obviously there are still 75 bytes with which to create some form of arbitrary large expression in order to obtain a lower score, but the resulting code would take longer than the heat death of the universe to run, so it's not quite suitable for TIO. Explanation:
Ｗ‽φ

While a random number 0..999 is non-zero...
⊞υω

...push the empty string to the empty list.
Ｉ⎇‽²Ｌυ±⊕Ｌυ

Randomly print either the length of the list or -1 minus that length.

bash + linux, 1 / big number
cat /dev/random | hexdump -n `b` -ve '/1 "%02u"'

This program will print out 'b' bytes of decimal digits, where b is a program producing a random input number.
(edited to try to be more infinity-ish, although technically still limited by the bash shell)

The spec explicitly requires Every integer is a possible output. A very large number of possible integers != every integer.

sorry! thats what i get for coding at 3 am.

looking at this again, other solutions have limited output as well. ??


text:
Special Character Coding Challenge - Check string for validity (Lots of rules)
There are 5 different "special characters": % & # $ !
These special characters are in a string with numbers. Like so: "5 !    60%2$5.3" (valid). You must determine the validity of the string and there are certain rules in order to determine validity of the string.
Rules:

These special characters can exist in a string, however they cannot be next to each other (ignoring spaces). For example:

"!%" is invalid
"% %" is invalid
"#     %    $" is invalid

The only exception to the rule above is with the exclamation mark. Only one exclamation mark may be after another special character. These assume there are numbers before and after the special characters. For example:

"!!" is valid
"!!!" is invalid
"$!" is valid
"$!!" is invalid
"!$" is invalid

If a special character is at the end of the string, there MUST be a number after it (ignoring spaces). If a special character is at the start of the string, there MUST be a number before it. For example:

"5!" is invalid
"5!5" is valid
"5#!5" is valid
"%5" is invalid

The only exception to the rule above is with the exclamation mark. There does not need to be a number before the exclamation mark assuming there is a number after it. For example:

"!5" is valid
”!!5" is invalid
"5!!5” is valid

If there is a string with only numbers, that string is valid, if there is a space between the space is invalid. For example:

"2   5" is invalid
"25" is valid

If a string only contains operators it is automatically invalid. For example:

"!#%" is invalid
"#" is invalid

Extra Examples of Strings that are VALID

"5%!5"
"!5 !5 %!5"
"5.4 $ 2.9 !3.4 &! 89.8213"

Extra Examples of Strings that are INVALID

"5%%5"  (reason: two "%%")
"!5!!!!!!!!%%%5" (reason: way too many operators next to each other)
"!5 !5 !" (reason: no number after the last "!")
"2.0%"  (reason: no number after "%")
"!6.9#" (reason: no number after "#")
"$6.9&" (reason: no number after "#" AND no number before "$")

A number is a run of 0-9 digits with a possible . to indicate decimals.
You can assume you will only get a string with either numbers and/or these special characters inside. You can also assume the numbers will not have floating zeros like 9.000 or 0004 or 00.00. Treat a single zero as any other number, so for example 0$0 is valid. You can assume you won't receive an empty string.
Game winning criteria objective: code-golf
(If you want a more difficult challenge try using python3 without using eval or exec.) This was originally planned.

@xnor oh my bad,

You need to specify what a number is. (I guess it is a run of 0-9 digits, possibly containing a single .. But will the numbers have leading zeros? If so, should it be considered valid?) Also, any challenge needs an objective winning criterion; I recommend [tag:code-golf] unless you have a good reason to use another scoring method. Other than that, I think it is a good first challenge.

@Bubbler thanks for the information. I have updated the question with your definition of a number. Is it better? Thank you for the help.

@JoKing thanks for the information. I have updated the question so you can assume you won't get an empty string

"If a special character is at the end of the string, there MUST be a number after it", doesn't this mean a special character cannot be at the end of a string?  Is there a difference?

For the first couple of sets of examples, I assume you don't mean that the string !! by itself is valid, but rather that those strings may appear in the input

How about .5 or 5.? No floating zeros, but what to do with floating decimal points?

What about !!8?  Valid or not?

@Xcali no not valid 8!!8 will be valid

@Schieru Asakoto just treat it as the same as any other number

@JoKing that's a correct assumption

That's far too soon to be accepting a solution.

@Shaggy oh fr my bad, couldn't I change it later tho?

Raku, 41 bytes
{?/^[\s*\!?\s*\d+\.?\d*\s*]+%<[%&#$!]>$/}

Try it online!
Checks if the input matches against a regex.
Explanation:
{?/^                                 $/}  # Check if the input is
    [                     ]+  # A series of
        \!?                   # An optional ! followed by
              \d+\.?\d*       # A number
     \s*   \s*         \s*    # Interspersed with optional whitespace
                            %           # Joined by
                             <[    ]>   # Any of
                               %&#!     # The special characters

Awesome, this is impressive. Looks like you're the winner so far

If you've got time you can try with python 3 without using eval or exec . That's what I had to do so it'll be interesting to see what another comes up with

@Nick ! HELP NICK I NEED YOU BRO NICK I NeED YOU BRO

05AB1E, 46 45  44  43 bytes
Crossed out  44  is no longer 44 :)
þ'.ªžQ7£`)5L.Þ:DÔƵKå≠s2K¤s¬4%s•8мZ_r•₄вå≠`P

-2 bytes thanks to @ExpiredData.
Outputs 1 for truthy and 0 or a positive integer for falsey (NOTE: only 1 is truthy in 05AB1E, so this is completely fine with the truthy/falsey definition of the meta).
Try it online or verify all test cases.
Explanation:
Unfortunately 05AB1E doesn't have any regexes. So instead I'll:
Convert the input to something that's easier to work with:
þ             # Only leave the digits of the (implicit) input-string
 '.ª         '# Convert the number to a list of digits, and append a "." to this list
žQ            # Push a constant with all printable ASCII characters (range [32,126])
  7£          # Only leave the first 7: ' !"#$%&'
    `         # Push them all separated to the stack
     )        # Wrap everything on the stack into a list
      5L      # Push a list [1,2,3,4,5]
        .Þ    # Extend the trailing item infinitely: [1,2,3,4,5,5,5,...]
          :   # Replace all characters in the (implicit) input-string with these
              # We now have a number consisting only of the digits [1,2,3,5],
              # where 1 is a digit or "."; 2 are spaces; 3 is "!"; and 4 is one of "%&#$"
              #  i.e. "5.4 $ 2.9 !3.4 &! 89.8213" → 1112521112311125321111111

After which it's easier to check whether it complies to all the rules:
Rule 5: check that there are no two numbers with spaces in between:
D             # Duplicate the number
 Ô            # Connected uniquify them (i.e. 1112521112311125321111111 → 1252123125321)
  ƵK          # Push compressed integer 121
    å≠        # And check that the number does NOT contains 121 as substring

Remove all spaces. And then rules 3 and 4: check that the input ends with a digit, and starts with a "!" or digit:
s             # Swap to get the number at the top again
 2K           # Remove all 2s (the spaces)
   ¤          # Push the last digit (without popping the number itself)
    s         # Swap again
     ¬        # And push the first digit (without popping the number itself)
      4%      # And take modulo 4, so 1 remains 1, and 5 becomes 1

Rules 1 and 2: check that it does not contain "!S"/"!!"/"!!!"/S!! (where S is one of the special characters "%&#$"):
s             # Swap to get the number at the top again
 •8мZ_r•      # Push compressed integer 35055333533
        ₄в    # Convert it to base-1000 as list: [35,55,333,533]
          å≠  # Check for each that the number does NOT contain it as substring
            ` # And push all four checks separated to the stack

And finally check if all were truthy:
P             # Then take the product of all values on the stack
              # (after which this is output implicitly as result)

See this 05AB1E tip of mine (sections How to compress large integers? and How to compress integer lists?) to understand why ƵK is 121; •8мZ_r• is 35055333533; and •8мZ_r•₄в is [35,55,333,533].

Nice detail and effort. Works. Very nice detailed explanation

@ExpiredData Thanks for the -1 with ₆<38Ÿç (will modify in a bit). As for your þ'.ªžQ7∍S`)5L.Þ:, its certainly a smart -2, but unfortunately the •n¨w!•Ƶêв will then increase to •1δ!»K•534в, neutralizing that -2. :(

@ExpiredData If I see correctly the S is removed, right? In which case it would be the same byte-count as right now, after your earlier suggested ₆<38Ÿç already saved a byte. But, I think the •1δ!»K•534в can be shortened to •8мZ_r•₄в, so then it would still save bytes, so thanks again! :)

Perl 5 -p, 72 bytes
$_=!/^[%#&\$]|^!!|([%#&!\$]\s*){3}|[%#!&\$]\s*[%#&\$]|\d\s+\d|\D$/&&/\d/

Try it online!

impressive, works like a charm

Python 3, 103 bytes
A function that does nothing if the string is valid, and raises SyntaxError if the string is invalid.

import re
r=re.sub
def f(s):exec(r("[%&#$!]","+",s)+";1or["+r(" ","",r("!","*",r("[%&#$]",",",s)))+"]")

Try it online!
Explanation
The idea is to exploit Python eval or exec, which can check if a string is a syntactically valid Python expression. This approach is longer than simply using regex to check, but I'll still post it since it's rather interesting.
Given a string, I want to transform it in a way such that only valid strings map to syntactically valid Python expressions. Specifically, I want to keep the numbers unchanged, and map the 5 special characters to Python operators.
Unfortunately, I wasn't able to find a simple mapping that works. Instead, I have to use 2 different transformations:
1) Replace all special characters with +.
For example !1.2 $ 3.4 &! 56.78 becomes +1.2 + 3.4 ++ 56.78.
If the result is valid Python, then the original string satisfies the last 2 rules (there must be at least 1 number, at least 1 operator between 2 numbers, and cannot end with an operator). Note that since + is both binary and unary, chained sequence of + is still valid Python.
2) Remove all spaces, map ! to *, map all other special characters to ,, and enclose everything within a pair of [] brackets.
For example !1.2 &! 3.4 !! 56.78 becomes [*1.2,*3.4**56.78] which is a list construction expression.
This way:

n ! n (where n is a number) becomes n*n, a valid product expression.
n # n becomes n,n, aka valid list elements.
! n becomes *n, which is valid Python since * is interpreted as splat/unpack operator during list creation.
n #! n becomes n,*n, again valid list elements (where the later element is a splat expression).
n !! n becomes n**n, which is just the valid power operator.
n ## n becomes n,,n which is invalid.
n !# n becomes n*,n which is invalid.
n #!! n becomes n,**n which is invalid.
n !!! n becomes n***n which is invalid.

This satisfies the first 4 rules.
Note that although a valid string will produce syntactically valid Python expression, trying to exec or eval the resulting expression will potentially raises TypeError, since the splat operator can only applied to container types, not numeric types (e.g *5 is syntactically valid, but if evaluated will raise TypeError). To get around this problem, I prepended 1 or to the resulting list expression, aka 1 or [...]. This way, the list construction will not be evaluated due to boolean short-circuiting.

Wow this is interesting, I was focusing on python too so good job. Nice detailed explanation. How do you think it would be without using eval or exec? That was my trouble

JavaScript (Node.js), 59 bytes
s=>/^!?\d+(\.\d+)?( *([%$#&!] *!?) *\d+(\.\d+)?)*$/.test(s)

Try it online!
This should be valid for all cases above. Assuming that floating decimal point won't occur.

@Bubbler Fixed.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
This highway needs rain across both of its lanes
In this challenge you will take a an ascii art image of a highway like so
 |   |   |  |  |  |
 |       |  |     |
 |   |   |  |  |  |
 |       |  |     |
 |   |   |  |  |  |
 |       |  |     |
 |   |   |  |  |  |

And you need to put rain across its lanes like so
 |\\\|\\\|  |\\|\\|
 |\\\\\\\|  |\\\\\|
 |\\\|\\\|  |\\|\\|
 |\\\\\\\|  |\\\\\|
 |\\\|\\\|  |\\|\\|
 |\\\\\\\|  |\\\\\|
 |\\\|\\\|  |\\|\\|

A highway will be defined as an ascii art string containing only the characters |,  and newlines. All rows of the image will have exactly the same number of characters.  Every column will be one of the following

Empty space, all spaces
A line, all |
A lane divider, alternating | and space

Furthermore there will always be a line before and after every lane divider.  So
|    |   | |   |
|          |   |
|    |   | |   |

would be valid but
|     |     |
|  |  |
|     |     |

would not be since there is no line after the last lane divider.
And a lane divider will never be exactly next to a line.
So
||   |
|    |
||   |

Is invalid but
|   ||  ||
|     | ||
|   ||  ||
|     | ||
|   ||  ||

is fine.
Additionally a highway must be at least two rows high and one column wide.
Task
Your job is to write a program or function that takes a valid highway (as a string or list of lines) as input and outputs the highway with rain across its lanes.
To put rain across a highway's lanes you must replace all space characters that appear between two consecutive lines, where those lines have at least one lane divider between them, with \s.  And leave all other characters the same.
So in the following diagram:
A   B   C   1   2  D
|   |   |       |  |
|   |   |   |      |
|   |   |       |  |
|   |   |   |      |

No rain should be put between A and B or B and C since there are no lane dividers between them, but rain should be put between C and D since lane dividers 1 and 2 are between them.
You may output an additional trailing newline, or add/remove trailing spaces from all lines equally if you wish.
This is code-golf so answers will be scored in bytes with fewer bytes being better.
Test cases
Simple case
 |   |   |  |  |  |
 |       |  |     |
 |   |   |  |  |  |
 |       |  |     |
 |   |   |  |  |  |
 |       |  |     |
 |   |   |  |  |  |

 |\\\|\\\|  |\\|\\|
 |\\\\\\\|  |\\\\\|
 |\\\|\\\|  |\\|\\|
 |\\\\\\\|  |\\\\\|
 |\\\|\\\|  |\\|\\|
 |\\\\\\\|  |\\\\\|
 |\\\|\\\|  |\\|\\|

Extra line
|    |   | |   |
|          |   |
|    |   | |   |

|\\\\|\\\|\|   |
|\\\\\\\\\\|   |
|\\\\|\\\|\|   |

Unsynced lane dividers
   |    |      |
   |        |  |
   |    |      |
   |        |  |
   |    |      |

   |\\\\|\\\\\\|
   |\\\\\\\\|\\|
   |\\\\|\\\\\\|
   |\\\\\\\\|\\|
   |\\\\|\\\\\\|

Empty road
|   |   |       |  |
|   |   |   |      |
|   |   |       |  |
|   |   |   |      |

|   |   |\\\\\\\|\\|
|   |   |\\\|\\\\\\|
|   |   |\\\\\\\|\\|
|   |   |\\\|\\\\\\|

False roads (suggested by Arnauld)
|   | | |   |
|   |   |   |
|   | | |   |
|   |   |   |

|   |\|\|   |
|   |\\\|   |
|   |\|\|   |
|   |\\\|   |

Hard lane divider
|  |  |  |  |
|     |     |
|  |  |  |  |
|     |     |

|\\|\\|\\|\\|
|\\\\\|\\\\\|
|\\|\\|\\|\\|
|\\\\\|\\\\\|

Adjacent lane dividers
|   ||  ||
|     | ||
|   ||  ||
|     | ||
|   ||  ||

|\\\||\\||
|\\\\\|\||
|\\\||\\||
|\\\\\|\||
|\\\||\\||

No lanes
|    |     |  |
|    |     |  |
|    |     |  |

|    |     |  |
|    |     |  |
|    |     |  |

One line
       |
       |
       |

       |
       |
       |

No lines

Do we need to handle lanes of arbitrary width, or is it okay to assume a single lane is never more than 25 (or some other number) spaces wide?

@Grimmy You should not assume that.  But I do understand that some languages have limits on how much memory they can index, so it would probably be Ok to assume that you can index the entire string.

Are we allowed to accept and/or output line lists?

@JonathanAllan It seems like that is what many people are doing.  I assume it is some sort of default or something.

I'm not sure it is, a list of characters may replace a string by default though. Maybe just specify that it is allowed :)

May we assume every line of text contains some characters? (I can't tell if the no-lines case is meant to include the four spaces per line that you put in your  block)

@JonathanAllan That case is intentionally 4 spaces per row.  Maybe this is a confusion between line and row. You will always have two rows.

Sorry line of text, so yes "per row of text". My confusion is that if I copy the post as displayed no space characters are copied for the "no lines" case. So, are we guaranteed at least one character per row?

I've fixed it up to display the spaces now.

That case is intentionally 4 spaces per row. Does that mean we're guaranteed at least 4 characters per row?

@Grimmy, No, I will allow a 1 character guarentee per the request of JA.

Jelly,  18  16 bytes
ZḢ”\E?€ṣ”|»Ṁ$€K»

A monadic Link accepting a list of lines, each of which is a list of characters, which yields another, similar list.
Try it online! Or see the test-suite.
How?
ZḢ”\E?€ṣ”|»Ṁ$€K» - Link: list of lists of characters (i.e. rows of text)
Z                - transpose - i.e. columns (each being: all spaces; all pipes; or a mix)
      €          - for each (column):
     ?           -   if...
    E            -   ...condition: all equal? - i.e. if not dashed
 Ḣ               -   ...then: head - i.e. the unique character
  ”\             -   ...else: literal '\' character
        ”|       - literal '|' character
       ṣ         - split at - i.e. highway chunks now contain spaces and '\' characters
             €   - for each (chunk):
            $    -   last two links as a monad:
           Ṁ     -     maximum - N.B. '\' > ' '
          »      -     maximum (vectorises across the chunk)
                 -   - i.e highway chunks become all '\', others remain as is
              K  - join with space characters
               » - maximum (vectorises across the rows)
                 -   - N.B. '|' > ' ' so the solid lines are not replaced by spaces; and
                 -          '|' > '\' so the dashed lines are not replaced with rain.

JavaScript (ES6),  118 ... 105  103 bytes
I/O format: matrix of characters.
a=>a.map(r=>r.map((c,i)=>(a[k=0][i]+a[1][i]<'||'?r:r=a.some(r=>r[a[k^=1].indexOf(c,i+1)]<c))/c?'\\':c))

Try it online!
How?
To detect lines, we test whether the first and the second row both contain a | at a given position \$i\$:
a[0][i] + a[1][i] < '||'  // true if it's not a line

When a line is detected:

We know for sure that the character \$c\$ at the same position in the current row is a |, because lines are guaranteed to go all the way from top to bottom. So we can now use \$c\$ instead of '|'.

We update the flag \$r\$ which is set to \$1\$ when we're located on a road with a lane divider.

We update \$r\$ by testing if, for some \$n\$, the next | (starting from \$i+1\$) in either the first or the second row (depending on the parity of \$n\$) is facing a space in the \$n\$-th row:
r = a.some(r => r[a[k ^= 1].indexOf(c, i + 1)] < c  // starting with k = 0

Finally, we must replace \$c\$ with a \ if \$c\$ is a space and \$r=1\$. Because a space is the only road character that is coerced to \$0\$, we can simply do:
r / c

The only truthy value is given by 1/' ' (\$+\infty\$). Something like 1/'|' would result in NaN, and so does 0/' ' (\$0/0\$).

05AB1E, 20 bytes
₆F€SøíJ„ \S„\|N_èì`:

Try it online!
₆F                    # repeat the following 36 times:
  €SøíJ               #  rotate 90 degrees
       „ \S           #  character array [' ', '\']
           „\|        #  string "\|"
              N       #  0-based iteration count
               _      #  logical not: 0 => 1, anything else => 0
                è     #  use that to index in the string "\|"
                 ì    #  prepend (first loop: ["| ", "|\"], then ["\ ", "\\"])
                  `:  #  recursive replace ("| " => "|\" or "\ " => "\\")

What's going on here?

@JonathanAllan Nice catch. Looks like a bug with legacy 05AB1E's ø, it doesn't work on strings that are exactly one character long. The actual test case has 4 spaces per row and works fine.

Python 3, 198 196 186 159 bytes
def g(x):
 for _ in x[0]:x=[''.join([q,'\\'][q<'!'and(x[a-1][b]>'['or'\\'in r[b-1]+r[-~b%len(r)])]for(b,q)in enumerate(x[a]))for(a,r)in enumerate(x)]
 return x

Try it online!
Explanation
This implements a simple automaton.  At every step a space is replaced with an \ iff one of the following is true

There is a | or \ above it (indexing wraps around)
There is \ to the left or right of it.

This means that rain starts at the gaps in the lane dividers and spreads until it hits |s.

Usually it's better to wait a bit longer before posting your own answer, in case someone else was working on a Python answer. And you can save 2 bytes by replacing the (b+1) with -~b.

@KevinCruijssen I waited an hour and then started writing this answer.  I think it is better to get the ball rolling in this case.

Uhh.. you can do that replacement for the exact reason you stated. ;) - and ~ have higher operator precedence than the %, so it will execute those first, saving 2 bytes on the parenthesis of (b+1). Relevant general tip and apparently the same tip is on the Python tip page as well.

155 bytes by going to Python v3.8 and using x:=, so you can transform it into a lambda.

Might want to mention that it wraps around the bottom to save confusion on how the \\s propagate upwards

Perl 5 -p, 52 51 bytes
/
/;s/(\S(.{@{-}})|\\)\K | (?=(?2)\S|\\)/\\/s&&redo

Replace space character with a backslash if there is a non-space character above or below it or a backslash on the right or the left of it. And redo while no more space can be replaced.
One byte saved diverting recursive regex thanks to Grimmy.
Try it online!

indeed diverting recursive regex

Python 2, 112 109 107 bytes
lambda r:reduce(lambda r,c:[''.join(l[::-1]).replace(c+' ',c+'\\')for l in zip(*r)],r'|\|\\\\:'*len(`r`),r)

Try it online!
Python 3.8 (pre-release), 109 bytes
Thanks to Kevin Cruijssen for this version!
lambda r:[(r:=[''.join(l[::-1]).replace(c+' ',c+'\\')for l in zip(*r)])for c in r'|\|\\\\:'*len(repr(r))][-1]

Try it online!
Port of my 05AB1E answer.

96 bytes by creating a lambda in Python 3.8

@KevinCruijssen your golf is based on the old, invalid version of my answer (can't hardcode 255 since lanes could be wider than that). See the current version.

Ah, hadn't noticed you updated it. And I'm afraid I'm not too skilled in Python, so not sure if that 109-byter can be shorter. Just remembered the new r:= variable assign from a recent other Python 3.8 answer and thought it might save some bytes by transforming it into a lambda instead of def-function. But I see you've already transformed it into a lambda to fix the incorrect assumption of no more than 255 iterations.

Jelly, 25 bytes
n⁶Zṣ1€oFẸḤƊ$€j1€W$Zị“|\ ”

Try it online!
oFẸḤƊ$€ is "borrowed" from @Riolku lol go upvote him
Explanation
n⁶Zṣ1€oFẸḤƊ$€j1€W$Zị“|\ ”  Main Link
n⁶                         vectorized inequality to space; "|" becomes 1, " " becomes 0
  Z                        transpose into a list of columns
   ṣ1€                     split by [1, 1, ..., 1] (length of original; number of rows)
            €              for each block (space between two lines)
      o                    vectorized OR with
       FẸḤ                 (flatten) (any) (double): 0 if there are only spaces; 2 if there are lane dividers
             j             join on
              1€W$         [1, 1, ..., 1] wrapped ([[1, 1, ..., 1]])
                  Z        zip back into original orientation
                   ị“|\ ”  index into "|\ "; 0s are spaces, 1s are lines, and 2s are the replaced spaces which become \

Haskell, 151 bytes
a#b=a!!mod b(length a)
z=zip[0..]
s%_=[[(['\\'|b<'!'&&(s#(x-1)#y>'['||elem '\\'[a#(y-1),a#(y+1)])]++[b])!!0|(y,b)<-z a]|(x,a)<-z s]
g x=foldl(%)x(x!!0)

Try it online!
Explanation
This implements the same algorithm as my python answer.  It implements a simple automaton. At every step a space is replaced with an \ iff at least one of the following is true

There is a | or \ above it (indexing wraps around)
There is \ to the left or right of it.

This means that rain starts at the gaps in the lane dividers and spreads until it hits |s.

Jelly, 25 bytes
Zn⁶ṣoFẸḤƊ$€jW}
ç1€ị“|\ ”Z

Try it online!
I/O is a list of strings
Explanation
Zn⁶ṣoFẸḤƊ$€jW}   Primary Link (dyad); takes the input on the left and [1, 1, ..., 1] on the right
Z                zip the input into a list of columns
 n⁶              vectorized inequality to space; "|" becomes 1, " " becomes 0
   ṣ             split (on [1, 1, ..., 1])
          €      for each block (between lines)
    o            vectorized or with
     FẸḤ         (flatten) (any) (double): 0 if there are only spaces; 2 if there are lane dividers
           jW}   join on ([1, 1, ..., 1] wrapped) (2,2-chain using })
ç1€ị“|\ ”Z       Main Link
ç                call the primary link with (default left argument),
 1€              [1, 1, ..., 1]
   ị“|\ ”        index into "|\ "
         Z       zip back into original orientation

Retina 0.8.2, 79 bytes
+m`(?<=(.)+) ((?<=(?(1).)^(?<-1>.)+\S.*¶.+|\\ )|(?=\\|.*¶(?<-1>.)+(?(1)$)\S))
\

Try it online! Same flood fill approach that @WheatWizard uses in his answers but using .NET balancing groups to detect vertical matches. Would save two bytes if the wind was blowing the other direction. Explanation:
+m`

Repeatedly replace and turn on line detection.
(?<=(.)+)

Replace a space but count the number of preceding characters on that line.
((?<=...|...)|(?=...|...)))
\

Replace with a backslash if one of the four conditions is true.
The four conditions are:
(?(1).)^(?<-1>.)+\S.*¶.+

This space is below rain or a lane divider. The (?(1).) can only succeed if the characters are in the same column.
\\

This space is to the right of existing rain.
\\

This space is to the left of existing rain.
.*¶(?<-1>.)+(?(1)$)\S

This space is above rain or a lane divider. The (?(1)$) can only succeed if the characters are in the same column.

Ruby, 144 bytes
->s{s.map{|l|((r=s[0]).size.times.map{|i|r[i]!=s[1][i]?[r.rindex(?|,i-1),r.index(?|,i+1)]:p}-[p]).map{|a,b|a.upto(b){|i|l[i]=?\\if l[i]<?!}};l}}

Try it online!
I thought I would try a different approach to the automaton. This finds lane dividers by checking for which indices the first two rows differ. It then goes through each of these indices and finds the previous and next line. It then fills in all space characters with the rain character.
This takes a list of strings for each row of the road.
Golfy Tricks:

Using l[i]<?! instead of l[i]==" ". This checks to see whether the character comes before ! (which only space does of the allowed charactersin this challenge).
-[p] to remove all nil elements in an array.
map instead of each.
size.times instead of chars.each_index
Using map with a condition (where failures result in nil and nils are then removed), rather than a select followed by a map.

Explanation:
->s{s.map{|l|((r=s[0]).size.times.map{|i|r[i]!=s[1][i]?[r.rindex(?|,i-1),r.index(?|,i+1)]:p}-[p]).map{|a,b|a.upto(b){|i|l[i]=?\\if l[i]<?!}};l}}

# Go through each character in the first row (saving the row in a variable for later use)
             ((r=s[0]).size.times.map
# Check if it's a line divider
                                         r[i]!=s[1][i]
# If it is, save the nearest road lines
                                                       [r.rindex(?|,i-1),r.index(?|,i+1)]
# If it isn't save nil
                                                                                p
# Remove all the nils
                                                                                -[p]
# So we have all the indices of the lanes
             ((r=s[0]).size.times.map{|i|r[i]!=s[1][i]?[r.rindex(?|,i-1),r.index(?|,i+1)]:p}-[p])
# For each row in the road
->s{s.map{|l|
# Go through each index within the lane
                                                                                .map{|a,b|a.upto(b)
# And set any empty charaters to rain
                                                                                l[i]=?\\if l[i]<?!
# And then return the new rainy row
                                                                                l

Bash + Core utilities, 154 152 145 142 136 119 bytes
IFS=\

read t
d=`sed s/././g<<<$t`
sed -E ":l;s/([|%]$d|%) /\1%/;tl;s/ ($d[|%]|%)/%\1/;tl;"'y/%@/\\\
/'<<<$t@`tr '
' @`

Try it online!
Input on stdin, and output on stdout.
(The script has spurious output to stderr in one case, but that's considered acceptable.)
Here are the outputs for the test cases:
highway-1-simple
 |\\\|\\\|  |\\|\\|
 |\\\\\\\|  |\\\\\|
 |\\\|\\\|  |\\|\\|
 |\\\\\\\|  |\\\\\|
 |\\\|\\\|  |\\|\\|
 |\\\\\\\|  |\\\\\|
 |\\\|\\\|  |\\|\\|

highway-2-extraline
|\\\\|\\\|\|   |
|\\\\\\\\\\|   |
|\\\\|\\\|\|   |

highway-3-unsyncedlanedividers
   |\\\\|\\\\\\|
   |\\\\\\\\|\\|
   |\\\\|\\\\\\|
   |\\\\\\\\|\\|
   |\\\\|\\\\\\|

highway-4-emptyroad
|   |   |\\\\\\\|\\|
|   |   |\\\|\\\\\\|
|   |   |\\\\\\\|\\|
|   |   |\\\|\\\\\\|

highway-5-falseroads
|   |\|\|   |
|   |\\\|   |
|   |\|\|   |
|   |\\\|   |

highway-6-hardlanedivider
|\\|\\|\\|\\|
|\\\\\|\\\\\|
|\\|\\|\\|\\|
|\\\\\|\\\\\|

highway-7-adjacentlanedividers
|\\\||\\||
|\\\\\|\||
|\\\||\\||
|\\\\\|\||
|\\\||\\||

highway-8-nolanes
|    |     |  |
|    |     |  |
|    |     |  |

highway-9-oneline
       |
       |
       |

highway-A-nolines

tl;tl might be reducible to just tl. More tentatively, maybe some the global flags can be dropped too? What is the purpose of the fold?

@user41805  Whoops... I think I have a copy and paste error.  (What I wrote works, but wasn't the fully golfed version.)  Let me check it out.

@user41805 Yes, that was not the version that I had intended to post.  It should be fixed now.  Thanks for pointing it out.

Husk, 21 20 15 bytes
-5 bytes thanks to Zgarb!
Tṁ?mσ' '\IV≠ġ▼T

Try it online! Takes input as a list of rows. Works by transposing rows and columns, splitting the columns into groups based on whether they have any spaces, adding rain to the column groups with lane divisions, recombining the column groups, and transposing back.

ġo¬€'  can be ġΛI since only whitespace is falsy and all columns have the same height.

Actually ġ▼ is even shorter.

And I think V#≠ can be just V≠ since the lane dividers will be the only different columns in each group.

Charcoal, 33 bytes
ＷＳ⊞υ⪫⪪ι ψＰ⪫υ¶Ｆ⊟υ¿⊖№ＫＤ²↓|ＫＫ«¤\↓¤\↗

Try it online! Link is to verbose version of code. Expects rectangular input with newline terminator. Explanation:
ＷＳ⊞υ⪫⪪ι ψ

Read the input but change spaces into nulls.
Ｐ⪫υ¶

Copy the input to the output; nulls turn into fillable spaces.
Ｆ⊟υ

Loop over the width of the input.
¿⊖№ＫＤ²↓|

Is this a lane divider? It isn't if it doesn't alternate between |s and empty cells.
ＫＫ

If it's not a divider then print the current character thus moving the cursor one step right. Simply moving right doesn't help because this needs to be a two-character Move command to avoid confusion with printing a lambda in a rightwards direction, and negating the condition doesn't help because when there are no lanes then Charcoal prints nulls instead of spaces for some inexplicable reason.
«¤\↓¤\↗

Fill the area with rain. Both the current cell and the cell below need to be checked as we don't know which one is empty. The cursor is then moved to the right of its original position.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
The shortest way of getting rid of these numbers
This is a simple game of getting rid of those damn numbers.
You start with the numbers from 1 to 19, written in a grid of 9 by 3:

1 2 3 4 5 6 7 8 9
1 1 1 2 1 3 1 4 1
5 1 6 1 7 1 8 1 9

You may notice that the number 10 is missing, this because the number zero would be hard to get rid of later on.
The two rules are:

If you find a pair of two numbers such that (a) they are equal OR (b) they add up to 10, you can eliminate both of them.
What is a valid pair? Either, they directly follow each other (ignoring any eliminated numbers, potentially continuing in the next row, but not connecting the last with the first row) when going left-to-right through the rows,
or they directly follow each other when going top-to-bottom through the columns (ignoring any eliminated numbers, not continuing in any following columns).

Small example:

2 9 1 2
3 4 5 6

Here, we can remove the pair (9, 1) as the sum is ten:

2 x x 2
3 4 5 6

Now we can remove (2, 2) as they are adjacent:

x x x x
3 4 5 6

Now, nothing else can be eliminated.

If nothing can be eliminated anymore, you will copy all remaining numbers to the bottom and continue.

Example. Starting with:

 1 2 3 4 5 6 7 8 X
 X X 1 2 1 3 1 4 1
 5 X X X 7 X 8 X X
 1 X X X X X X X X
 X X X X X X X 2 X
 4 5 X X 4 X 5 6 X
 8

we get:

 1 2 3 4 5 6 7 8 X
 X X 1 2 1 3 1 4 1
 5 X X X 7 X 8 X X
 1 X X X X X X X X
 X X X X X X X 2 X
 4 5 X X 4 X 5 6 X
 8 1 2 3 4 5 6 7 8
 1 2 1 3 1 4 1 5 7
 8 1 2 4 5 4 5 6 8

You have won the game when all numbers are eliminated.
The shortest solution in terms of moves (either an elimination or a "copy remainder") wins this challenge.
If you can prove your solution to be the shortest possible (for example by doing exhaustive BFS), you get extra points.
Tell us about your crazy optimizations you used to make this fit into memory!
Showing us your code that you used to get to your solution is highly recommended.
Further examples of valid pairs:

1 X 2
3 4 5
X 6 7
 Here, only (4,6) is a valid pair to eliminate, as they add up to ten and are directly adjacent in a column (ignoring all Xs in between).

1 X X
X X X
X X 9
 The only valid pair is (1, 9), as they are directly adjacent row-wise (ignoring the many eliminated numbers in between).

I'm vaguely remembering that there's a mobile game for this puzzle. Is that where you got the idea from?

The "What is a valid pair? ..." is not all that clear. Could you use [[1,x,2],[3,4,5],[x,6,7]] as an example and list them maybe? I would guess: (1,2), (2,3), (3,4), (4,5), (5,6), (6,7), (1,3), (4,6), (2,5), (5,7) but I may be mistaken.

@mypetlion My girlfriend is playing this by hand, she got it from someone else - as to where it is originally from, I could not find anything. Happy to learn more!

@Arnauld the single 8 stems from a previous round of "adding the numbers". Just as a further example:
[ 1 2 3 4 5 6 7 X X ]
[ X X X X 1 3 1 4 X ]
[ 5 X 6 1 7 1 8 X X ]
will result in
[ 1 2 3 4 5 6 7 X X ]
[ X X X X 1 3 1 4 X ]
[ 5 X 6 1 7 1 8 X X ]
[ 1 2 3 4 5 6 7 1 3 ]
[ 1 4 5 6 1 7 1 8 ]

@JonathanAllan In your example, I only see the valid pair (4, 6), as they add up to ten. (1,2) e.g. is not a valid pair, as they do not add up to ten NOR are they equal.

I mean, what constitutes as a possible pair to check for validity? The sum to ten or equal part is easy to follow it's this text that is not: "Either, they directly follow each other (ignoring any eliminated numbers, potentially continuing in the next row, but not connecting the last with the first row) when going left-to-right through the rows, or they directly follow each other when going top-to-bottom through the columns (ignoring any eliminated numbers, not continuing in any following columns)."

So the valid pair condition means the pair is valid if they are adjacent after chaining all numbers either by row or by column and all Xs are removed? Also I suppose that being an atomic code-golf challenge we aren't supposed to give program code but instead the steps needed, are we?

@ShieruAsakoto Chaining by Row is allowed (but not connecting top left with bottom right, so not a full circle), but chaining columns is not allowed. I would prefer that solutions also show code, but a valid sequence of moves would be enough :)

I remember a nice discussion on Meta on questions like this that ask to construct an "artifact". I'm happy to see this one. It looks like we don't have a tag specifically for this kind of thing, and the question's tag of [tag:atomic-code-golf] is probably the closest.

36 moves
This Rust program finds a 36 move solution in half a second.  There’s room to make the search faster, but this solution may already be optimal.
Solution
1 2 3 4 5 6 7 8 9
1 X X 2 1 3 1 4 1
5 1 6 1 7 1 8 1 9

1 2 3 4 5 6 7 8 9
1 . . 2 1 3 1 4 1
5 1 6 1 7 1 8 X X

X 2 3 4 5 6 7 8 9
X . . 2 1 3 1 4 1
5 1 6 1 7 1 8 . .

. 2 3 4 5 6 7 8 X
. . . 2 1 3 1 4 X
5 1 6 1 7 1 8 . .

. 2 3 4 5 6 7 X .
. . . X 1 3 1 4 .
5 1 6 1 7 1 8 . .

. 2 3 4 5 6 7 . .
. . . . 1 3 1 4 .
5 1 6 1 7 1 8 . .
2 3 4 5 6 7 1 3 1
4 5 1 6 1 7 1 8

. 2 3 4 5 6 7 . .
. . . . 1 3 1 4 .
5 1 6 1 7 1 X . .
X 3 4 5 6 7 1 3 1
4 5 1 6 1 7 1 8

. 2 3 4 5 6 7 . .
. . . . 1 3 1 4 .
5 1 X 1 7 1 . . .
. 3 X 5 6 7 1 3 1
4 5 1 6 1 7 1 8

. 2 3 4 5 6 7 . .
. . . . 1 3 1 4 .
5 X . X 7 1 . . .
. 3 . 5 6 7 1 3 1
4 5 1 6 1 7 1 8

. 2 3 4 5 6 7 . .
. . . . 1 3 1 4 .
5 . . . 7 1 . . .
. 3 . 5 6 7 X 3 1
4 5 1 6 1 7 X 8

. 2 3 4 5 6 7 . .
. . . . 1 3 1 4 .
5 . . . 7 1 . . .
. 3 . 5 6 X . X 1
4 5 1 6 1 7 . 8

. 2 3 4 5 6 7 . .
. . . . 1 3 1 4 .
5 . . . 7 1 . . .
. 3 . 5 6 . . . 1
4 5 1 6 1 7 . 8 2
3 4 5 6 7 1 3 1 4
5 7 1 3 5 6 1 4 5
1 6 1 7 8

. 2 3 4 5 6 7 . .
. . . . 1 3 1 4 .
5 . . . 7 1 . . .
. 3 . 5 6 . . . 1
4 5 1 6 1 7 . X X
3 4 5 6 7 1 3 1 4
5 7 1 3 5 6 1 4 5
1 6 1 7 8

. 2 3 4 5 6 7 . .
. . . . 1 3 1 4 .
5 . . . 7 1 . . .
. 3 . 5 6 . . . 1
4 5 1 6 1 X . . .
X 4 5 6 7 1 3 1 4
5 7 1 3 5 6 1 4 5
1 6 1 7 8

. 2 3 4 5 6 7 . .
. . . . 1 3 1 4 .
5 . . . 7 1 . . .
. 3 . 5 6 . . . 1
4 5 1 6 1 . . . .
. 4 5 6 7 1 3 1 4
5 7 X 3 5 6 1 4 5
1 6 X 7 8

. 2 3 4 5 6 7 . .
. . . . 1 3 1 4 .
5 . . . 7 1 . . .
. 3 . 5 6 . . . 1
4 5 1 6 1 . . . .
. 4 5 6 7 1 3 1 4
5 X . X 5 6 1 4 5
1 6 . 7 8

. 2 3 4 5 6 7 . .
. . . . 1 3 1 4 .
5 . . . 7 1 . . .
. 3 . 5 6 . . . 1
4 5 1 6 1 . . . .
. 4 5 6 7 1 3 1 4
X . . . X 6 1 4 5
1 6 . 7 8

. 2 3 4 5 6 7 . .
. . . . 1 3 1 4 .
5 . . . 7 1 . . .
. 3 . 5 6 . . . 1
4 5 1 6 1 . . . .
. 4 5 6 7 1 3 1 X
. . . . . X 1 4 5
1 6 . 7 8

. 2 3 4 5 6 7 . .
. . . . 1 3 1 4 .
5 . . . 7 1 . . .
. 3 . 5 6 . . . 1
4 5 1 6 1 . . . .
. 4 5 6 7 1 3 X .
. . . . . . X 4 5
1 6 . 7 8

. 2 3 4 5 6 7 . .
. . . . 1 3 1 4 .
5 . . . 7 1 . . .
. 3 . 5 6 . . . 1
4 5 1 6 1 . . . .
. X 5 6 7 1 3 . .
. . . . . . . 4 5
1 X . 7 8

. 2 3 4 5 6 7 . .
. . . . 1 3 1 4 .
5 . . . 7 X . . .
. 3 . 5 6 . . . 1
4 5 1 6 1 . . . .
. . 5 6 7 X 3 . .
. . . . . . . 4 5
1 . . 7 8

. 2 3 4 5 6 7 . .
. . . . 1 3 1 4 .
5 . . . X . . . .
. X . 5 6 . . . 1
4 5 1 6 1 . . . .
. . 5 6 7 . 3 . .
. . . . . . . 4 5
1 . . 7 8

. 2 3 4 5 6 7 . .
. . . . 1 3 1 4 .
X . . . . . . . .
. . . X 6 . . . 1
4 5 1 6 1 . . . .
. . 5 6 7 . 3 . .
. . . . . . . 4 5
1 . . 7 8

. 2 3 4 5 6 7 . .
. . . . 1 3 1 X .
. . . . . . . . .
. . . . X . . . 1
4 5 1 6 1 . . . .
. . 5 6 7 . 3 . .
. . . . . . . 4 5
1 . . 7 8

. 2 3 4 5 6 7 . .
. . . . 1 3 X . .
. . . . . . . . .
. . . . . . . . X
4 5 1 6 1 . . . .
. . 5 6 7 . 3 . .
. . . . . . . 4 5
1 . . 7 8

. 2 3 4 5 6 7 . .
. . . . 1 3 . . .
. . . . . . . . .
. . . . . . . . .
4 5 1 6 1 . . . .
. . 5 6 X . X . .
. . . . . . . 4 5
1 . . 7 8

. 2 3 4 5 6 7 . .
. . . . 1 3 . . .
. . . . . . . . .
. . . . . . . . .
4 5 1 6 1 . . . .
. . 5 X . . . . .
. . . . . . . X 5
1 . . 7 8

. 2 3 4 5 6 7 . .
. . . . 1 3 . . .
. . . . . . . . .
. . . . . . . . .
4 5 1 6 1 . . . .
. . X . . . . . .
. . . . . . . . X
1 . . 7 8

. 2 3 4 5 6 7 . .
. . . . X 3 . . .
. . . . . . . . .
. . . . . . . . .
4 5 1 6 X . . . .
. . . . . . . . .
. . . . . . . . .
1 . . 7 8

. 2 3 4 5 6 X . .
. . . . . X . . .
. . . . . . . . .
. . . . . . . . .
4 5 1 6 . . . . .
. . . . . . . . .
. . . . . . . . .
1 . . 7 8

. 2 3 4 5 X . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
X 5 1 6 . . . . .
. . . . . . . . .
. . . . . . . . .
1 . . 7 8

. 2 3 4 X . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. X 1 6 . . . . .
. . . . . . . . .
. . . . . . . . .
1 . . 7 8

. 2 3 X . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . 1 X . . . . .
. . . . . . . . .
. . . . . . . . .
1 . . 7 8

. 2 3 . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . X . . . . . .
. . . . . . . . .
. . . . . . . . .
X . . 7 8

. 2 X . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . X 8

. X . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . X

Code
use std::collections::HashSet;

fn start() -> Vec<i32> {
    (1..10).chain((1..10).flat_map(|i| vec![1, i])).collect()
}

fn display(solution: &[Option<(usize, usize)>]) {
    let mut grid = start();
    for &step in solution {
        if let Some((i, j)) = step {
            grid[i] = 0;
            grid[j] = 0;
        } else {
            grid.extend(&grid.iter().copied().filter(|&n| n != 0).collect::<Vec<_>>());
        }
        for (k, row) in (0..).step_by(9).zip(grid.chunks(9)) {
            for (l, &n) in (k..).zip(row) {
                if n != 0 {
                    print!("{} ", n);
                } else if let Some((i, j)) = step {
                    if l == i || l == j {
                        print!("X ");
                    } else {
                        print!(". ");
                    }
                } else {
                    print!(". ");
                }
            }
            println!();
        }
        println!();
    }
    println!("{} moves", solution.len());
    println!();
}

fn search(
    grid: &mut Vec<i32>,
    solution: &mut Vec<Option<(usize, usize)>>,
    best: &mut usize,
    mut skips: usize,
    prune: &mut HashSet<(usize, usize)>,
) {
    let len = grid.len();
    if solution.len() >= *best || len >= *best * 2 {
        return;
    }

    let mut pruned = vec![];
    (|| {
        let mut stuck = true;
        let mut i = !0;
        let mut m = !0;
        for j in 0..len {
            let n = grid[j];
            if n != 0 {
                if m == n || m + n == 10 {
                    if !prune.contains(&(i, j)) {
                        grid[i] = 0;
                        grid[j] = 0;
                        solution.push(Some((i, j)));
                        search(grid, solution, best, skips, prune);
                        solution.pop();
                        grid[i] = m;
                        grid[j] = n;
                    }
                    if skips == 0 {
                        return;
                    }
                    stuck = false;
                    skips -= 1;
                    prune.insert((i, j));
                    pruned.push((i, j))
                }
                i = j;
                m = n;
            }
        }
        if i == !0 {
            *best = solution.len();
            display(solution);
            return;
        }
        for k in 0..9 {
            i = !0;
            m = !0;
            for j in (k..len).step_by(9) {
                let n = grid[j];
                if n != 0 {
                    if m == n || m + n == 10 {
                        if !prune.contains(&(i, j)) {
                            grid[i] = 0;
                            grid[j] = 0;
                            solution.push(Some((i, j)));
                            search(grid, solution, best, skips, prune);
                            solution.pop();
                            grid[i] = m;
                            grid[j] = n;
                        }
                        if skips == 0 {
                            return;
                        }
                        stuck = false;
                        skips -= 1;
                        prune.insert((i, j));
                        pruned.push((i, j))
                    }
                    i = j;
                    m = n;
                }
            }
        }
        if stuck {
            grid.extend(&grid.iter().copied().filter(|&n| n != 0).collect::<Vec<_>>());
            solution.push(None);
            search(grid, solution, best, skips, &mut HashSet::new());
            solution.pop();
            grid.truncate(len);
        }
    })();
    for m in pruned {
        prune.remove(&m);
    }
}

fn main() {
    let mut grid = start();
    let mut best = 200;
    for skips in 0.. {
        println!("skips = {}", skips);
        search(
            &mut grid,
            &mut vec![],
            &mut best,
            skips,
            &mut HashSet::new(),
        );
    }
}

Also, there’s a 26 move solution if you’re allowed to do a copy-remaining even when another move is available. The rules seem to say you’re not, though.

Very nice! Checking your solution made me realize an error in my implementation, so thank you twice!
I tried implementing a BFS to have a guarantee for finding the shortest solution, but I can not get past depth 28 due to the exponential blowup in the search tree. With incremental DFS, 36 steps is definitely the shortest solution possible under the given rules. :)


text:
(RGS 5/5) Computing the set of all set partitions with fixed sizes
Task
Given a set of n unique elements and a multiset l of positive numbers that add up to n, find all the ways of partitioning those unique elements into disjoint sets with sizes given by the elements of l.
(A multiset is a set that allows repeated elements)
The point here is that we are taking everything in the output as sets, so order doesn't matter in any place.
This may be simpler to understand if you check some test cases below.
Input
The multiset l of positive integers that add up to n. Note that the elements in l may appear repeatedly. This might be given as

a list l = [1, 1, 2, 2, 3]
arguments to a function f(1, 1, 2, 2, 3)
or any other sensible way of representing a multiset

You may assume the representation of l is ordered.
You may also take a list/set/collection of n distinct integers, or you may generate it depending on the sum of the elements in l. If you generate it, you may use any n distinct integers for the set to be partitioned but your remaining code should work for any set of n integers. The set you use must be specified in your answer. Suggestions include:

a range starting in 0: [0, 1, ..., n-1]
a range starting in 1: [1, 2, ..., n]

Output
The different ways in which your collection can be split in sets with the given sizes. Your output should be unambiguous.
Reference implementation
You can find a vanilla python reference implementation here or you can try it online.
Test cases
I am using the set 0, ..., n-1 when the list adds up to n. In the TIO link, that list is given explicitly to my function.
After the ->, each line represents one possible way of splitting the set.
[1, 1, 1, 1, 1, 1, 1, 1] -> [
    [[0], [1], [2], [3], [4], [5], [6], [7]]
]

[3] -> [
    [[0, 1, 2]]
]

[1, 2] -> [
    [[0], [1, 2]]
    [[1], [0, 2]]
    [[2], [0, 1]]
]

[2, 2] -> [
    [[0, 1], [2, 3]]
    [[0, 2], [1, 3]]
    [[0, 3], [1, 2]]
]

[1, 1, 2] -> [
    [[0], [1], [2, 3]]
    [[0], [2], [1, 3]]
    [[0], [3], [1, 2]]
    [[1], [2], [0, 3]]
    [[1], [3], [0, 2]]
    [[2], [3], [0, 1]]
]

[1, 2, 2] -> [
    [[0], [1, 2], [3, 4]]
    [[0], [1, 3], [2, 4]]
    [[0], [1, 4], [2, 3]]
    [[1], [0, 2], [3, 4]]
    [[1], [0, 3], [2, 4]]
    [[1], [0, 4], [2, 3]]
    [[2], [0, 1], [3, 4]]
    [[2], [0, 3], [1, 4]]
    [[2], [0, 4], [1, 3]]
    [[3], [0, 1], [2, 4]]
    [[3], [0, 2], [1, 4]]
    [[3], [0, 4], [1, 2]]
    [[4], [0, 1], [2, 3]]
    [[4], [0, 2], [1, 3]]
    [[4], [0, 3], [1, 2]]
]

[2, 2, 2] -> [
    [[0, 1], [2, 3], [4, 5]]
    [[0, 1], [2, 4], [3, 5]]
    [[0, 1], [2, 5], [3, 4]]
    [[0, 2], [1, 3], [4, 5]]
    [[0, 2], [1, 4], [3, 5]]
    [[0, 2], [1, 5], [3, 4]]
    [[0, 3], [1, 2], [4, 5]]
    [[0, 3], [1, 4], [2, 5]]
    [[0, 3], [1, 5], [2, 4]]
    [[0, 4], [1, 2], [3, 5]]
    [[0, 4], [1, 3], [2, 5]]
    [[0, 4], [1, 5], [2, 3]]
    [[0, 5], [1, 2], [3, 4]]
    [[0, 5], [1, 3], [2, 4]]
    [[0, 5], [1, 4], [2, 3]]
]

[1, 2, 3] -> [
    [[0], [1, 2], [3, 4, 5]]
    [[0], [1, 3], [2, 4, 5]]
    [[0], [1, 4], [2, 3, 5]]
    [[0], [1, 5], [2, 3, 4]]
    [[0], [2, 3], [1, 4, 5]]
    [[0], [2, 4], [1, 3, 5]]
    [[0], [2, 5], [1, 3, 4]]
    [[0], [3, 4], [1, 2, 5]]
    [[0], [3, 5], [1, 2, 4]]
    [[0], [4, 5], [1, 2, 3]]
    [[1], [0, 2], [3, 4, 5]]
    [[1], [0, 3], [2, 4, 5]]
    [[1], [0, 4], [2, 3, 5]]
    [[1], [0, 5], [2, 3, 4]]
    [[1], [2, 3], [0, 4, 5]]
    [[1], [2, 4], [0, 3, 5]]
    [[1], [2, 5], [0, 3, 4]]
    [[1], [3, 4], [0, 2, 5]]
    [[1], [3, 5], [0, 2, 4]]
    [[1], [4, 5], [0, 2, 3]]
    [[2], [0, 1], [3, 4, 5]]
    [[2], [0, 3], [1, 4, 5]]
    [[2], [0, 4], [1, 3, 5]]
    [[2], [0, 5], [1, 3, 4]]
    [[2], [1, 3], [0, 4, 5]]
    [[2], [1, 4], [0, 3, 5]]
    [[2], [1, 5], [0, 3, 4]]
    [[2], [3, 4], [0, 1, 5]]
    [[2], [3, 5], [0, 1, 4]]
    [[2], [4, 5], [0, 1, 3]]
    [[3], [0, 1], [2, 4, 5]]
    [[3], [0, 2], [1, 4, 5]]
    [[3], [0, 4], [1, 2, 5]]
    [[3], [0, 5], [1, 2, 4]]
    [[3], [1, 2], [0, 4, 5]]
    [[3], [1, 4], [0, 2, 5]]
    [[3], [1, 5], [0, 2, 4]]
    [[3], [2, 4], [0, 1, 5]]
    [[3], [2, 5], [0, 1, 4]]
    [[3], [4, 5], [0, 1, 2]]
    [[4], [0, 1], [2, 3, 5]]
    [[4], [0, 2], [1, 3, 5]]
    [[4], [0, 3], [1, 2, 5]]
    [[4], [0, 5], [1, 2, 3]]
    [[4], [1, 2], [0, 3, 5]]
    [[4], [1, 3], [0, 2, 5]]
    [[4], [1, 5], [0, 2, 3]]
    [[4], [2, 3], [0, 1, 5]]
    [[4], [2, 5], [0, 1, 3]]
    [[4], [3, 5], [0, 1, 2]]
    [[5], [0, 1], [2, 3, 4]]
    [[5], [0, 2], [1, 3, 4]]
    [[5], [0, 3], [1, 2, 4]]
    [[5], [0, 4], [1, 2, 3]]
    [[5], [1, 2], [0, 3, 4]]
    [[5], [1, 3], [0, 2, 4]]
    [[5], [1, 4], [0, 2, 3]]
    [[5], [2, 3], [0, 1, 4]]
    [[5], [2, 4], [0, 1, 3]]
    [[5], [3, 4], [0, 1, 2]]
]

[1, 1, 4] -> [
    [[0], [1], [2, 3, 4, 5]]
    [[0], [2], [1, 3, 4, 5]]
    [[0], [3], [1, 2, 4, 5]]
    [[0], [4], [1, 2, 3, 5]]
    [[0], [5], [1, 2, 3, 4]]
    [[1], [2], [0, 3, 4, 5]]
    [[1], [3], [0, 2, 4, 5]]
    [[1], [4], [0, 2, 3, 5]]
    [[1], [5], [0, 2, 3, 4]]
    [[2], [3], [0, 1, 4, 5]]
    [[2], [4], [0, 1, 3, 5]]
    [[2], [5], [0, 1, 3, 4]]
    [[3], [4], [0, 1, 2, 5]]
    [[3], [5], [0, 1, 2, 4]]
    [[4], [5], [0, 1, 2, 3]]
]

This is the fifth and final challenge of the RGS Golfing Showdown. If you want to participate in the competition, you have 96 hours to submit your eligible answers. Remember there is still 300 reputation in prizes! (See 6 of the rules)
Also, as per section 4 of the rules in the linked meta post, the "restricted languages" for this third challenge are only Sledgehammer, J and Mathematica so submissions in these languages are not eligible for the final prize. But they can still be posted!!
Final prize
If you want to be considered for the final prize, at the end of your answer to this challenge please add a link to the eligible submissions you want to be considered for your final score, as well as the scores those answers got! This way it will be slightly easier for me to keep track of everything. Thanks!
This is still a regular code-golf challenge, so enjoy!

For the first test case why isn't [[0],[1],[2],[3],[4],[5],[7],[6]] valid?

@ExpiredData My understanding is that the output is a multiset as well, so this would just be a different representation of the same output -- and that would be valid as long as you return only one of them.

@Arnauld thanks for your feedback. Tbh ordering the representation of l isn't of interest. I say we can assume the representation of l is ordered.

05AB1E, 9 bytes
œεI£€{{}ê

Try it online!
œ           # permutations of the [0, ..., n-1] input
 ε     }    # for each permutation:
  I£        #  cut it in parts of lengths given by the second input
    €{      #  sort each part
      {     #  sort the list of parts
        ê   # sort and uniquify the list of lists of parts

Dang, you make it look so simple!.. :D

Hey there, are you competing for the final prize of the RGS Golfing Showdown? If so, please include links to the answers of the previous challenges you want to submit! Thanks :)

@RGS no, i'm not.

Python 3, 123 118 114 112 bytes
Input: set s representing a list of n unique elements, and an iterable l representing the multiset.
Output: a set of all partitions, where each partition is a tuple of tuples of elements (aka output is a set of tuples of tuples).
lambda s,l:{(*sorted(p),)for p in product(*(combinations(s,i)for i in l))if{*sum(p,p)}>s}
from itertools import*

Try it online!
Approach
Step 1: For each element i of the multiset l, we find all combinations of i elements of s. We then find the Cartesian products of them. This is the list of candidate partitions.
For example: for l = [1,2], s = ABC, we first find all combinations

of 1 element: A, B, C
of 2 elements: AB, AC, BC

The candidate partitions are the Cartesian product of the above list of combinations:
[A,AB]
[A,AC]
[A,BC]
[B,AB]
[B,AC]
[B,BC]
[C,AB]
[C,AC]
[C,BC]

Step 2: Filter out the invalid partitions (partitions that do not add up to s).
For the above example, only the following partitions are kept:
[A,BC]
[B,AC]
[C,AB]

Code breakdown
lambda s,l:
{
  (*sorted(p),)                     # convert partition to a sorted tuple (of tuples)
  for p in product(                 # for each candidate partition
    *(combinations(s,i)for i in l)
  )
  if{*sum(p,p)}>s                   # keep only if partition add up to s
}                              # put everything in a set to filter out duplicates

Each partition is stored as a sorted tuple of sorted tuple. This ensure no duplicate in the final result.
{*sum(p,p)}>s checks if a candidate partition is valid (aka contains all element in s). This work by putting all elements in the partition and some extra elements into a set, then check if the set is a superset of s.
For example: for s={0,1,2,3} and valid partition p=((0,1),(2,3)):
sum(p,p) evaluates to ((0,1),(2,3),0,1,2,3), which when converted into set is a superset of s.
For s={0,1,2,3} and invalid partition p=((0,1),(1,2)):
sum(p,p) evaluates to ((0,1),(1,2),0,1,2), which when converted into set becomes {0,1,2,(0,1),(1,2)}, not a superset of s.

JavaScript (ES6),  158 156  141 bytes
Takes input as (a)(r), where \$a\$ is the representation of the input set \$l\$ as an ordered array, and \$r\$ is the range \$[1,2,...,n]\$.
Prints the results.
a=>r=>(F=(k,m,o=[],p,s=[],n=a[k])=>n?s[n-1]?F(++k,m,[...o,s],a[k]-n?0:s[0]):r.map(i=>i<p|m>>i&1||F(k,m|1<<i,o,i,[...s,i])):console.log(o))(0)

Try it online!
Commented
a =>                      // a[] = ordered representation of the input set
r => (                    // r[] = range [1, 2, ..., n]
  F = (                   // F is a recursive function taking:
    k,                    //   k = index of the current entry in a[]
    m,                    //   m = bitmask of values already assigned in the output
    o = [],               //   o[] = output
    p,                    //   p = either 0 or a previous value (as a lower bound)
    s = [],               //   s[] = array representing the current set
    n = a[k]              //   n = k-th entry in a[]
  ) =>                    //
    n ?                   // if n is defined:
      s[n - 1] ?          //   if the current set is not full:
        F(                //     do a recursive call:
          ++k,            //       increment k
          m,              //       pass m unchanged
          [...o, s],      //       append s[] to o[]
          a[k] - n ? 0    //       set p to 0 if the next set has a different size
                   : s[0] //       or to s[0] if it has the same size
        )                 //     end of recursive call
      :                   //   else:
        r.map(i =>        //     for each value i in the range r[]:
          i < p |         //       abort if i is less than p
          m >> i & 1 ||   //       or the i-th bit is already set in m
          F(              //       otherwise, do a recursive call:
            k,            //         pass k unchanged
            m | 1 << i,   //         set the i-th bit in m
            o,            //         pass o unchanged
            i,            //         set p to i
            [...s, i]     //         append i to s[]
          )               //       end of recursive call
        )                 //     end of map()
    :                     // else:
      console.log(o)      //   leaf node: print o[]
)(0)                      // initial call to F with k = 0

Previous answers

RGS 1/5 - JavaScript, 37 bytes
RGS 2/5 -
CP-1610 machine code, 28 bytes (or 27.5)
RGS 3/5 - JavaScript, 79 bytes
RGS 4/5 - JavaScript, 206 bytes

Total score: 491 bytes

Thanks for your JS submission. I take it you don't want to be considered in the final leaderboard?

@RGS Not that it really matters, but I've added links to my previous entries.

Wolfram Language (Mathematica), 63 bytes
Uses the range [1,2,...,n]
Union[Sort/@(Sort/@#~TakeList~a&/@Permutations@Range@Tr[a=#])]&

Try it online!

Jelly, 16 15 13 bytes
Œ!ṁ€R}Ṣ€Ṣ¥€ṢQ

-2 bytes thanks to @NickKennedy by golfing the loose link to an inline one with }.
Try it online.
Explanation:
Œ!ṁ€R}Ṣ€Ṣ¥€ṢQ  # Main link taking two list arguments
               # i.e. left=[0,1,2,3,4]; right=[1,2,2]
Œ!             #  Get all permutations of the (implicit) left argument
               #   i.e. [0,1,2,3,4] → [[0,1,2,3,4],[0,1,2,4,3],...,[4,3,2,1,0]]
     }         #  Turn a monad into a dyad by using the right argument:
    R          #   Create a range of each inner integers
               #    i.e. [1,2,2] → [1,[1,2],[1,2]]
  ṁ€           #   And mold each permutation based on that
               #    i.e. [3,0,2,4,1] and [1,[1,2],[1,2]] → [3,[0,2],[4,1]]
          €    #  Map,
         ¥     #  using the previous two links as dyad:
      Ṣ€       #   Sort each inner-most list
               #    → [[0,[1,2],[3,4]],[0,[1,2],[3,4]],...,[4,[2,3],[0,1]]]
        Ṣ      #   Then sort each inner list
               #    → [[0,[1,2],[3,4]],[0,[1,2],[3,4]],...,[[0,1],[2,3],4]]
           Ṣ   #  And after the map, sort the outer list
               #   → [[0,[1,2],[3,4]],[0,[1,2],[3,4]],...,[[0,4],[1,3],2]]
            Q  #  And uniquify it
               #   → [[0,[1,2],[3,4]],[0,[1,3],[2,4]],...,[[0,4],[1,3],2]]
               #  (after which the result is output implicitly)

Original 16 15 bytes answer:
⁹R⁸ṁ
Œ!çṢ€Ṣɗ€ṢQ

First (semi-complex) Jelly answer, so can definitely be golfed.. I probably can't find the builtins I'm looking for, since I have the feeling there should be a builtin for ⁹R⁸ṁ similar as 05AB1E's £.
Port of the approach used by @Grimmy in his 05AB1E answer.
Try it online.
Explanation:
⁹R⁸ṁ        # Define a link taking two list arguments
            # i.e. left=[1,2,2]; right=[3,0,2,4,1]
⁹           #  Use the left argument
 R          #  And create a range of each inner integers
            #   i.e. [1,2,2] → [1,[1,2],[1,2]]
  ⁸         #  Then take the right argument
   ṁ        #  And mold it based on the earlier list
            #   i.e. [3,0,2,4,1] and [1,[1,2],[1,2]] → [3,[0,2],[4,1]]

Œ!çṢ€Ṣɗ€ṢQ  # Main link taking two list arguments
            # i.e. left=[0,1,2,3,4]; right=[1,2,2]
Œ!          #  Get all permutations of the (implicit) left argument
            #   i.e. [0,1,2,3,4] → [[0,1,2,3,4],[0,1,2,4,3],...,[4,3,2,1,0]]
       €    #  Map,
      ɗ     #  using the previous three links as dyad:
  ç         #   Apply the link we defined above,
            #   which uses this main-link's right as left argument for the helper-link
            #    → [[0,[1,2],[3,4]],[0,[1,2],[4,3]],...,[4,[3,2],[1,0]]]
   Ṣ€       #   Sort each inner-most list
            #    → [[0,[1,2],[3,4]],[0,[1,2],[3,4]],...,[4,[2,3],[0,1]]]
     Ṣ      #   Then sort each inner list
            #    → [[0,[1,2],[3,4]],[0,[1,2],[3,4]],...,[[0,1],[2,3],4]]
        Ṣ   #  And after the map, sort the outer list
            #   → [[0,[1,2],[3,4]],[0,[1,2],[3,4]],...,[[0,4],[1,3],2]]
         Q  #  And uniquify it
            #   → [[0,[1,2],[3,4]],[0,[1,3],[2,4]],...,[[0,4],[1,3],2]]
            #  (after which the result is output implicitly)

And not that it matters, but my other RGS Golfing Showdown answers are:

1/5: MathGolf or Stax, both 9 bytes (or Java 10, 58 bytes)
2/5: Java 8, 76 bytes (or Whitespace, 149 bytes)
3/5: Java 8, 107 bytes
4/5: Java 8, 261 bytes

Total score: 466 bytes

A solid 1st submission and a solid final submission! Then a lot of really interesting submissions, only not in competitive languages. Does this make sense?

My alternative 10 byter is what I think you were going for. However, I found a slightly shorter solution using combinations.

@NickKennedy Are you sure yours are correct, though? You seem to have more outputs than I have.

@NickKennedy I've golfed my answer using that ṁ€R}. If you want to post it as your own answer let me know, then I will undo my -2 golf.

Happy with you using it. I’ll check why you’re getting a different answer for mine.

@KevinCruijssen fixed at a cost of 3 bytes. Mine originally only worked where the set lengths were unique.

@NickKennedy Will take a closer look at both your and Jonathan's answers to hopefully learn a bit from it.

@RGS Thanks for the bounty. Is that because you liked my Jelly answer most for this 5/5 challenge? Because I clearly didn't win the entire competition, haha. ;)

The winner was Jonathan Allan and I will set the bounty up soon. You got the random bonus internet points for this challenge :)

Jelly, 12 bytes
œcŒpFQƑ$ƇṢ€Q

Try it online!
A dyadic link taking the list of \$n\$ integers as the left argument and the list of set lengths as the right. Returns a list of lists.
Thanks to @KevinCruijssen for pointing out an omission in my original answer.
Previous RGS submissions:

Jelly 12 bytes
BBC BASIC V 92 bytes
Jelly 37 bytes
R 128 bytes
Jelly 12 bytes (this post)

Total: 281 bytes

Jelly, 12 bytes
œcŒpṢ€FQƑ$ƇQ

Try it online!

Overal RGS admissible competition entries:
RGS 1/5 - Jelly, 7
RGS 2/5 - Husk, 22
RGS 3/5 - Jelly, 36
RGS 4/5 - MATL, 26 *
This: 12
Total = 103 bytes
* Might be 25, but I haven't proven that the 25 would never yield multiple results

Interesting that we converged in almost the same answer again. I added the Ṣ€Q to my original 9-byter without seeing yours!

Oh, nice; I tried œ!Œp for a while but then realised œcŒp would do some of the filtering for me for free.

@KevinCruijssen thanks, I've fixed the link

Congratulations on winning the RGS competition, I hope you had some fun!

05AB1E, 18 17 bytes
œ€.œ€`€€{ʒ€gQ}€{Ù

Try it online!, or verify some test cases

Explanation
                                     - Takes input of the numbers [1..N]
œ                                    - Permutations of this list
 €.œ                                 - Partitions of each of these permutations
    €`                               - Flatten these 1 level
      €€{                            - Sort the lists in each list in each partition
        ʒ                            - Filter the partitions
          €g                         - Where the size of the sub partitions...
            Q}                       - Equal to the second input (l)
              €{Ù                    - Sort and uniquify these
                                     - Output implicitly

Submissions for consideration
(4/5) Sledgehammer 6 bytes
(3/5) 05AB1E 38 bytes
(2/5) C# 76 bytes
(1/5) 05AB1E 6 bytes
Total = 143

As of now, your code doesn't work! Consider this test case, where should only be 3 outputs but your code returns 6, because it is considering the orderings of the small sets of size 2. Please ping me when you fix this! :)

@ExpiredData For starters you can remove the trailing }, so you're indeed correct yours is easier shortened. ;p

@Arnauld is this solution working now?

@ExpiredData Yes, I think so!

Hey there, just to let you know that you placed 3rd in the RGS!

Japt -Q, 13 bytes
á £V®Xj0Z ñ
â

Try it
Submissions
(1/5) Japt, 9 bytes
(2/5) CJam, 23 bytes
(3/5) Japt, 40 or 41 bytes (I don't know which one to use, I'm not sure if the 40 byte one is valid)
(4/5) Magma, 34 bytes
Total Score: 120 (or maybe 119)

Hey there, just to let you know that you placed 2nd in the RGS!

J, 47 bytes
[:~.~:@I.(/:(#,])&.>)@(<@/:~;.1)"1[:(!A.&i.])+/

Try it online!
I entirely missed the Portuguese one, so I'm out of the final prize anyway.
And J is not so good for handling non-rectangular arrays.
How it works
[:~.~:@I.(/:(#,])&.>)@(<@/:~;.1)"1[:(!A.&i.])+/

[:(!A.&i.])+/    NB. all permutations of 0..n-1
           +/    NB. sum of l, i.e. the value of n
  (   &i.])      NB. array of 0..n-1
   !  &i.        NB. array of 0..n!-1
    A.           NB. (0..n!-1)-th permutations of 0..n-1

~:@I.    NB. cut vector (1 2 3 -> 1 1 0 1 0 0)
   I.    NB. for each number k at index i, k copies of i
         NB. e.g. 1 2 3 -> 0 1 1 2 2 2
~:@      NB. nub sieve; does each item appear for the first time?

(/:(#,])&.>)@(<@/:~;.1)"1    NB. cut, sort each item, and sort each row
                       "1    NB. on each row...
             (     ;.1)    NB. cut to the lengths of l
                           NB. e.g. 1 1 0 (f;.1) 0 1 2 -> (f 0)(f 1 2)
              <@/:~        NB. sort each item and enclose
(          )@     NB. then...
 /:               NB. sort the row by...
   (   )&.>       NB. the result applied to each item x...
    #,]           NB. the length of x, followed by x itself
                  NB. that is, sort by lengths then content

[:~.    NB. finally, remove duplicate rows to get the answer

Husk, 14 bytes
u→SġÖȯLuΣmOΠMṖ

Try it online!
...I feel like the →SġÖȯLuΣ (last-entry-of hook group-by sort-by compose length deduplicate concatenated) should be XȯLuΣ where X is "maximals-by-predicate", saving 3 bytes, but I can't seem to find such a high-level-function. Maybe I'm being blind?

Are you going to compete for the final prize?

Yep, thanks - I've updated my Jelly answer.

Hey there, just to let you know that you won the RGS!

GAP, 145 127 105 bytes
f:={l,c}->(i->Orbit(SymmetricGroup(c),Set(l,n->Set([1..n],k->NextIterator(i))),OnSetsSets))(Iterator(c));

Try it online!
This is absurdly long, but I like computing the answer as an orbit of a group action. I have mixed feelings about creating the first element using an Iterator...

What is the "first element" and the "Iterator"? If that Iterator(PositiveIntegers) is just "a list of the first positive integers" to be the elements of the set of sets, you can take it as input.

@RGS By "first element" I mean the expression Set(l,n->Set([1..n],k->NextIterator(i))) which e.g. for input [1,1,4] computes [[1],[2],[3,4,5,6]]. It is the starting point for the Orbit computation, The Iterator i here is an object that on each call of NextIterator gives me the next unused positive integer.

Charcoal, 95 bytes
⊞υＥ⊕⌈θＥ№θι⟦⟧Ｆη«≔υζ≔⟦⟧υＦζＦＬκＦ∨⊕⌕§κλ⟦⟧№θλ¿‹Ｌ§§κλμλ⊞υＥκ⎇⁻ξλνＥν⎇⁻ρμπ⁺π⟦ι⟧»≔⟦⟧ζＦυ«≔⟦⟧εＦιＦκ⊞ελ⊞ζε»⪫ζ¶

Try it online! Link is to verbose version of code. I don't often get to use the r variable; I think this might be only the second time ever. Takes the set counts and unique entries as arguments. Explanation:
⊞υＥ⊕⌈θＥ№θι⟦⟧

Make a list of lists of sets (also actually lists), where each element of that list will have a number of sets equal to the count of occurrences of that index in the input set counts, and push that list to the predefined empty list, which is now technically a list of lists of lists of lists.
Ｆη«

Loop over the unique entries.
≔υζ≔⟦⟧υ

Move the list of lists of lists of sets into a temporary variable so that it can be cleared to accumulate the results of this pass.
Ｆζ

Loop over each list of lists of sets from the previous pass.
ＦＬκ

Loop over each possible set count.
Ｆ∨⊕⌕§κλ⟦⟧№θλ

Loop over each set, but if there is more than one empty set then stop at the first.
¿‹Ｌ§§κλμλ

Ignore this set if it's full.
⊞υＥκ⎇⁻ξλνＥν⎇⁻ρμπ⁺π⟦ι⟧

Construct a new list of lists of sets by replacing the one at the current set count with a new list of sets constructed by replacing the current set by union with the current unique entry. This is done to ensure that the new lists are all clones.
»≔⟦⟧ζＦυ«≔⟦⟧εＦιＦκ⊞ελ⊞ζε»

Flatten each list of lists of sets in the resulting list into a list of sets.
⪫ζ¶

Output the list of lists of sets in a human-readable manner. (This only costs 1 byte, so I think it's fair.)
Submission history:
(1/5) Charcoal, 19 bytes (Retina 0.8.2, 68 bytes)
(2/5) Charcoal, 31 bytes (Retina, 74 bytes)
(3/5) vi, 48 bytes (Charcoal, 50 bytes; Batch, 265 bytes)
(4/5) Charcoal, 41 bytes
(5/5) Charcoal, 95 bytes
Total score: 234 bytes
Total Charcoal score: 236 bytes
Wooden Spoon score: 543 bytes

R (with partitions library), 86 bytes
function(l,n)lapply(partitions::listParts(n),function(x)if(all(lengths(x)==l))show(x))

Try it online at RDRR!
Assumes that l is sorted in decreasing order. Will print a lot of fluff after the answer, so I advise to call invisible(f(l, n)) rather than f(l, n).
The function listParts lists all the partitions of 1:n; they are then filtered to keep only those whose lengths match the values of l.
Previous submissions, all in R (not that R is a competitive language!):

38 bytes
73 bytes (also SPL, 398 bytes)
111 bytes
68 bytes

Total: 376 bytes

Pyth, 20 bytes
{SMfqQlMTSMMs./M.pUs

Try it online!
Explanation
{SMfqQlMTSMMs./M.pUsQ # full program (Q=input, last one is implicit)
                  UsQ # range(sum(Q))
                .p    # get all permutations
            s./M      # for each permutation, get all partitions, concatenate to one list
         SMM          # sort each list in each partition
   f                  # keep only the partitions T where
    qQ                # Q ==
      lMT             #      map each list in a partition T to its length
 SM                   # now sort the filtered partitions
{                     # and deduplicate