HNHacker News
TopNewBestAskShowJobs

bugfix-66

501 karma · joined September 24, 2022

A debugging game for hackers: https://BUGFIX-66.com
submissionscomments
bugfix-66··on DeviantArt upsets artists with its new AI art generator, DreamUp
These systems aggregate and interpolate human work. Interpolation: https://en.m.wikipedia.org/wiki/Interpolation

It's like a very complicated form of linear interpolation:

  a*x + (1-a)*y
These systems do not "think". Today I spent all day mulling an idea, experimenting with variations, feeling frustrated or excited, imagining it, simulating it, making mistakes, following paths of reasoning, deducing facts, revisiting dead-ends with new insight, daydreaming, talking to my wife about it, etc. That's human thought.

These models do not "think" like a human, they do not dream or imagine or feel. They run a feed-forward system of linear equations (matrix multiplications).

They INTERPOLATE HUMAN WORK.

They don't exist without training data (huge amounts of intellectual property) aggregated and interpolated in a monstrous perversion of "fair use":

https://bugfix-66.com/7a82559a13b39c7fa404320c14f47ce0c304fa...

Starve the machine. Without your work, it's got nothing.

bugfix-66··on DeviantArt upsets artists with its new AI art generator, DreamUp
Thank you for saying it.

We're surrounded by people who don't understand what's happening. They seem to think some kind of art intelligence has been invented.

No, it's the aggregation and interpolation of vast amounts of existing art.

The same thing is happening with software, through Microsoft's Copilot:

https://bugfix-66.com/7a82559a13b39c7fa404320c14f47ce0c304fa...

I think people just don't understand what they're seeing. They have no idea what it is.

They think it's really "intelligence", dreaming and imagining and simulating and feeling and experimenting and...

It's none of these things. It's a sophisticated interpolation, not so different from linear interpolation:

  a*x + (1-a)*y
bugfix-66··on Show HN: Lidar Obstacle Detection in 50 Lines of Go
This is a drivable road regions (obstacle detection) algorithm found in what appears to be a git repo leaked from an autonomous vehicle company in 2017. The repo was available through one or more Tor hidden services for several years.

The lidar code (in an almost-C dialect of C++, a ROS node) appears to be written for the Velodyne HDL-32E. It operates in a series of stages, each stage refining the output of the previous stage. This algorithm is in the second stage. It is the primary obstacle detection method, with the other methods making only small improvements.

The leaked code uses a column-major matrix of points and it explicitly handles NaNs (the no-return points). We've rewritten it to use a much more cache-efficient row-major matrix layout and a conditional that will ignore the NaN points without explicit testing.

This is an amazingly effective method of obstacle detection, considering its simplicity. We've tested this using a VLP-32C lidar, user manual here if you're interested:

https://icave2.cse.buffalo.edu/resources/sensor-modeling/VLP...

bugfix-66··on NSA guidance on how to protect against software memory safety issues [pdf]
Well, to begin with, Go passes function arguments in registers since 1.17

Go 1.17 implements a new way of passing function arguments and results using registers instead of the stack. Benchmarks for a representative set of Go packages and programs show performance improvements of about 5%, and a typical reduction in binary size of about 2%. (https://go.dev/doc/go1.17)

I think the basic problem here is that you don't know the facts.

bugfix-66··on NSA guidance on how to protect against software memory safety issues [pdf]
If you don't appreciate, or don't understand, C-style pointers (they're just addresses, where nil is a very useful value) then you won't like C and you won't like Go.

Go is an improved C. It's for people who like C but need C's well-understood problems fixed.

C-style pointers are not a problem. They don't need to be fixed. They're great, and that's why Go retains them.

Here is an example of C-style code making essential use of C-style pointers (especially nil pointers) but it's Go:

https://bugfix-66.com/50788214f539d50382528e86242eb3c846b03f...

You need to be able to represent addresses, and you need to be able to say "address of nothing" (i.e., nil pointer).

bugfix-66··on NSA guidance on how to protect against software memory safety issues [pdf]
Sure: if you don't like C, you won't like Go.

Sounds like C is not your thing, and that's ok.

bugfix-66··on NSA guidance on how to protect against software memory safety issues [pdf]
Obviously we aren't!
bugfix-66··on NSA guidance on how to protect against software memory safety issues [pdf]
TLDR: Transition from C to Go.

Go was designed by (among others) the father of Unix, Ken Thompson, with an understanding of the mistakes of C and C++. Despite getting hilariously little respect here on Hacker News, the language is (for many purposes) an excellent replacement for C.

(Yes, yes, I know you disagree. Tell me more about how C++ is necessary and all the time you spend fighting it is actually a huge win! Please tell me how slow garbage collection is, all evidence to the contrary!)

Go reads from, and writes to, variable-sized blocks of memory through (pointer, length, capacity) triples, known as "slices". A Go slice "[]int" is essentially a C struct like this, passed around in 3 registers:

  struct IntSlice {
      int* pointer;
      ssize_t length;
      ssize_t capacity;
  };
Bounds checking in Go is easily disabled (pass -B flag to the compiler) but almost nobody does so because the performance benefit is miniscule. With bounds checking and garbage collection, Go avoids almost all memory-related bugs.

You can understand Go as C redesigned for a world where parallel computing (e.g., dozens of CPU cores) is commonplace, and the benefits of safe code outweigh the tiny costs.

We're not using 80286 chips anymore. We can afford safety.

bugfix-66··on Lidar obstacle detection algorithm from a Git repo leaked onto Tor
This is a drivable region mapping (obstacle detection) algorithm found in what appears to be a git repo leaked from an autonomous vehicle company in 2017. The repo was available through one or more Tor hidden services for several years.

The lidar code appears to be written for the Velodyne HDL-32E. It operates in a series of stages, each stage refining the output of the previous stage. This algorithm is in the second stage. It is the primary obstacle detection method, with the other methods making only small improvements.

The leaked code uses a column-major matrix of points and it explicitly handles NaNs (the no-return points). We've rewritten it to use a much more cache-efficient row-major matrix layout and a conditional that will ignore the NaN points without explicit testing.

This is an amazingly effective method of obstacle detection, considering its simplicity.

bugfix-66··on Fuzzy Substring Matching: On-Device Fuzzy Friend Search at Snapchat
There's a very old and strange approximate string matching algorithm in agrep (approximate grep).

Here it is in its most simplified form (zero mismatches):

https://bugfix-66.com/e61f9c6080791c9ea8983af748db704238cbb7...

This might be the simplest and most elegant linear time string search algorithm.

bugfix-66··on Libsecded
"Donated this to Microsoft Copilot for you."

In this case djb won't mind (CC0 license).

But it's time to move away from GitHub.

bugfix-66··on Libsecded
https://pqsrc.cr.yp.to/libsecded-20220828/INTERNALS.html

libsecded encodes an n-byte array using an extended Hamming code on the bottom bit of each byte, in parallel an extended Hamming code on the next bit of each byte, etc.

https://en.m.wikipedia.org/wiki/Hamming_code

Extended Hamming codes achieve a Hamming distance of four, which allows the decoder to distinguish between when at most one one-bit error occurs and when any two-bit errors occur. In this sense, extended Hamming codes are single-error correcting and double-error detecting, abbreviated as SECDED.

The main idea is to choose the error-correcting bits such that the index-XOR (the XOR of all the bit positions containing a 1) is 0. We use positions 1, 10, 100, etc. (in binary) as the error-correcting bits, which guarantees it is possible to set the error-correcting bits so that the index-XOR of the whole message is 0. If the receiver receives a string with index-XOR 0, they can conclude there were no corruptions, and otherwise, the index-XOR indicates the index of the corrupted bit.

Hamming codes have a minimum distance of 3, which means that the decoder can detect and correct a single error, but it cannot distinguish a double bit error of some codeword from a single bit error of a different codeword. Thus, some double-bit errors will be incorrectly decoded as if they were single bit errors and therefore go undetected, unless no correction is attempted.

To remedy this shortcoming, Hamming codes can be extended by an extra parity bit. This way, it is possible to increase the minimum distance of the Hamming code to 4, which allows the decoder to distinguish between single bit errors and two-bit errors. Thus the decoder can detect and correct a single error and at the same time detect (but not correct) a double error.

bugfix-66··on How to write a hardcore punk riff [video]
Make it sound like what "Amyl & The Sniffers" are doing:

Guided By Angels: https://youtu.be/Z--D1flPLnk

Hertz: https://youtu.be/zb5Ja6V4OeY

Best modern punk band by a mile, lead singer is incredible!

bugfix-66··on Stable Diffusion Like Music Video, Lorn – Entropyyy[video]
Lorn used to be great. For example, listen to Anvil, watch the beautiful video:

https://youtu.be/CqaAs_3azSs

It's art, not incoherent, glitchy AI drivel!

bugfix-66··on Nearly all binary searches and mergesorts are broken (2006)
That is correct. A serious mistake in C.

Go was designed by (among others) the father of Unix Ken Thompson, with an understanding of the mistakes of C and C++.

Another example is that Go requires explicit integer casts (disallowing implicit integer casts) to avoid what is now understood to be an enormous source of confusion and bugs in C.

You can understand Go as an improved C, designed for a world where parallel computing (e.g., dozens of CPU cores) is commonplace.

bugfix-66··on Nearly all binary searches and mergesorts are broken (2006)
Here is the approach taken in Go's sort.Search()

Do the sum using signed int.

Then cast to unsigned int before the division (i.e., use a non-arithmetic shift low).

Then cast back to signed int.

  func Search(n int, f func(int) bool) int {
      // Define f(-1) == false and f(n) == true.
      // Invariant: f(i-1) == false, f(j) == true.
      i, j := 0, n
      for i < j {
          h := int(uint(i+j) >> 1) // avoid overflow when computing h
          // i ≤ h < j
          if !f(h) {
              i = h + 1 // preserves f(i-1) == false
          } else {
              j = h // preserves f(j) == true
          }
      }
      // i == j, f(i-1) == false, and f(j) (= f(i)) == true  =>  answer is i.
      return i
  }
If you care about stuff like this you may enjoy the puzzle "Upside-Down Arithmetic Shift":

https://bugfix-66.com/76b563beb6f4e61801fce4e835be862fb3dbbe...

bugfix-66··on Microsoft sued for open-source piracy through GitHub Copilot
I don't think so.

Please refer to the material I provided. Clear examples of use being restricted (decompilation, disassembly, copying, publication of performance measurements, etc.)

A license can restrict use, and we need to do exactly that (restrict use in training models and in inference) to address this new kind of threat to intellectual property rights.

bugfix-66··on Microsoft sued for open-source piracy through GitHub Copilot
The BSD 2-Clause License appears to attach conditions to both "redistribution" and "use". Quote:

  All rights reserved.

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
  are met:
Is that a mistake in the BSD license? I don't think so. I think you are mistaken.

See the discussion here "Can a software license impose restrictions on the place where the software is to be used, so that a court would enforce those restrictions?"

https://law.stackexchange.com/questions/78519/can-a-software...

There are numerous examples there of licenses restricting use: Apple's licenses, the Unreal Engine, etc.

License Restrictions Sample Clauses:

  License Restrictions. Licensor reserves all rights not expressly granted to You. The Software is licensed for Your internal use only. Except as this Agreement expressly allows, You may not (1) copy (except for back-up purposes), modify, alter, create derivative works, reverse engineer, decompile, or disassemble the Software except and only to the extent expressly permitted by applicable law; (2) transfer, assign, pledge, rent, timeshare, host or lease the Software, or sublicense any of Your license grants or rights under this Agreement; in whole or in part, without prior written permission of Licensor; (3) remove any patent, trademark, copyright, trade secret or other proprietary notices or labels on the Software or its documentation; or (4) disclose the results of any performance, functional or other evaluation or benchmarking of the Software to any third party without the prior written permission of Licensor. Hosting Restrictions. In the event that You desire to have a third party manage, host (either remotely or virtually) or use the Software on Your behalf, You shall (1) first enter into a valid and binding agreement with such third party that contains terms and conditions to protect Licensor’s rights in the Software that are no less prohibitive and/or restrictive than those contained in this Agreement, including, without limitation, the Verification section below; (2) prohibit use by such third party except for the sole benefit of You; and (3) be solely responsible to Licensor for any and all breaches of the above terms and conditions by such third party.
If a license can prohibit decompilation or copying, we can obviously prohibit language model training.

And that's what we need to do, for the reasons stated here:

https://bugfix-66.com/7a82559a13b39c7fa404320c14f47ce0c304fa...

bugfix-66··on Microsoft sued for open-source piracy through GitHub Copilot
The No-AI 3-Clause License:

https://bugfix-66.com/7a82559a13b39c7fa404320c14f47ce0c304fa...

This is the only license to explicitly disallow language model training and inference using your code.

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
  are met:

  ...

  3. Use in source or binary form for the construction or operation
     of predictive software generation systems is prohibited.
All other licenses seem to apply only when the code is emitted, and therefore can't really protect you. This attacks the problem at the source. If Microsoft trains Copilot on your code, they are unambiguously violating an explicit condition that controls use.

Otherwise, it's just the standard BSD 2-Clause License.

bugfix-66··on Ask HN: License to prohibit training of systems like Microsoft Copilot
Explained here:

https://bugfix-66.com/7a82559a13b39c7fa404320c14f47ce0c304fa...

bugfix-66··on Show HN: The No-AI 3-Clause License (explicitly prohibits, e.g., GitHub Copilot)
If the fair use argument holds, there will be no possible defense against it. Microsoft will convert all open source into anonymous common property and monetize it.

That's the hopeless scenario.

Otherwise, the fair use argument fails to be upheld. Then Microsoft must argue that normally Copilot regurgitates a mixture of patterns from various sources, and therefore the licenses in the training data can be ignored.

To defeat this fall-back argument, we must attack the root of the problem: the moment our code is used in training.

That's precisely what the No-AI 3-Clause License achieves, while otherwise being the permissive BSD 2-Clause License that we know and love.

bugfix-66··on Show HN: The No-AI 3-Clause License (explicitly prohibits, e.g., GitHub Copilot)
Microsoft can argue that Copilot emits a mixture of intellectual property (a pattern from here, a pattern from there), so they don't need to give attribution.

But if we disallow training, it's unambiguous.

Either you fed the program into your training system or you didn't. The No-AI 3-Clause License forbids use in training, no question about it. If you train your model on this text, you are obviously violating the license.

Systems like Microsoft Copilot are a new threat to intellectual property. The open source licenses need to change to adapt to the threat.

Otherwise Microsoft and Amazon will pillage open source software, converting all our work into anonymous common property that they can monetize.

We're watching it happen.

bugfix-66··on Show HN: The No-AI 3-Clause License (explicitly prohibits, e.g., GitHub Copilot)
Take another look. We removed the "Open Source" wording in response to your comments.

And it was never intended to be a Free/Copyleft license: this is a permissive MIT- or BSD-style license.

The No-AI 3-Clause License explicitly and unambiguously prohibits TRAINING.

No other license does so. That's the key difference.

bugfix-66··on Show HN: The No-AI 3-Clause License (explicitly prohibits, e.g., GitHub Copilot)
See discussion of an earlier draft here:

https://news.ycombinator.com/item?id=33458374

We've removed "Open Source" from the name because the license may be incompatible with point 6 of the OSI definition here: https://en.m.wikipedia.org/wiki/The_Open_Source_Definition

Here is the license text:

  Copyright (C) <YEAR> <COPYRIGHT HOLDER>

  All rights reserved.

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
  are met:

  1. Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution.

  3. Use in source or binary form for the construction or operation
     of predictive software generation systems is prohibited.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The above is a verbatim (word-for-word) copy of the BSD 2-Clause License (https://en.m.wikipedia.org/wiki/BSD_licenses), except for the addition of a third clause:

  3. Use in source or binary form for the construction or operation
     of predictive software generation systems is prohibited.
The BSD license restricts both "redistribution" and "use":

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
  are met:
Training a Copilot-like system is unambiguously "use" in violation of the new third clause.

Comments and suggestions are welcome.

bugfix-66··on Ask HN: License to prohibit training of systems like Microsoft Copilot
It's certainly less ambiguous.

The BSD license restricts both "redistribution" and "use":

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
  are met:
Training a Copilot-like system is "use" in obvious violation of clause 3:

  3. Use in source or binary forms for the construction or operation
     of predictive software generation systems is prohibited.
What else can we do?
bugfix-66··on Ask HN: License to prohibit training of systems like Microsoft Copilot
I see, it's clause 6 in the OSI definition:

  6. No discrimination against fields of endeavor: The license must not restrict anyone from making use of the program in a specific field of endeavor. For example, it may not restrict the program from being used in a business, or from being used for genetic research.
So it's one or the other. Basically, Copilot makes all open source software (according to the OSI definition) necessarily use-without-attribution. Your code is my code. Your work is instantly my work, and no credit will be given.

I think this is a special case, illustrating that these new language models require us to reformulate our conception of what "open source" and "fair use" entails.

The laws and definitions need to adapt to a changing world.

bugfix-66··on Ask HN: License to prohibit training of systems like Microsoft Copilot
Please elaborate on this surprising claim, in detail.

Here is the OSI definition of Open Source:

https://en.m.wikipedia.org/wiki/The_Open_Source_Definition

bugfix-66··on Ask HN: License to prohibit training of systems like Microsoft Copilot
It's the BSD 2-clause license, a very old, very widely-used, and very respectable open source license:

https://en.m.wikipedia.org/wiki/BSD_licenses

We've added one additional clause EXPLICITLY PROHIBITING use in systems like Copilot.

There's no ambiguity. Training your language model is a direct and unequivocal violation of clause 3.

If this is not adequate to prevent Copilot-style intellectual property theft then nothing is.

How else can we protect ourselves from Copilot-style use without attribution?

bugfix-66··on Ask HN: License to prohibit training of systems like Microsoft Copilot
We're consulting the lawyers here:

https://www.saverilawfirm.com/our-cases/github-copilot-intel...

I'll let you know what they say.

bugfix-66··on Ask HN: What can I personally do to fight AGAINST the Copilot class action?
You can't take a person's name off their work and sell it.

People who work hard to produce open source software expect credit and acknowledgement for their work. That's why almost every license has an attribution clause.

If you don't want credit for your work, you use the MIT No Attribution License:

https://opensource.org/licenses/MIT-0

Not widely used, as you might expect.

← PreviousPage 3 of 7Next →