Steve Roush [Thu, 18 Mar 2021 01:51:10 +0000 (18:51 -0700)]
Fix for TBbalance attribute code
As described in #1339 TBbalance is an undocumented graph attribute that is
supposed to cause nodes to "rise" or "fall" to the minimum or maximum rank
possible. The attached code snippet seems to repair the bug in this code.
Comment from Matthew Fernandez: I committed this, but I don’t understand enough
about the context to judge its correctness. The above is Steve’s description of
the situation.
fix incorrect reference counting of interned HTML strings
This typo meant that, instead of masking the reference counting bits, this check
was also including the HTML bit (bit 31). As a result, interned HTML strings
would never be freed. This was found by an introduced -Wlogical-op warning when
building an upcoming change with GCC 8.3.0.
383ec8753b8007d26fc4f6eb51c61b6d8b71d12e added a pylint task in CI. This task is
unrestricted, so Gitlab thinks it is meant to run on tags as well as on master.
Every other task is restricted to only run on master (including the dependencies
of the pylint job) so CI now fails on tags. This change limits the lint job to
not run on tags. Fixes #1978.
This is just doing boolean logic. Sometimes there is a motivation to use bitwise
operators in place of boolean operators to optimize hot paths that are
negatively affected by the stalling semantics of boolean shortcut logic. But
this is not the case here. This is not a hot path.
Core support for this was removed in 2009. A partial plugin for this was written
but never matured. This was removed in 5243eaac9cbe134fc7935a8c029860632e19d523.
This change removes the final dangling references to DIA. Fixes #689.
To move towards using more inclusive terminology, this removes references to the
“master” branch of the repository and replaces them with references to “main.”
At time of writing, master is still the default branch of the Graphviz
repository but after merging this commit the default branch can be changed to
main.
It is unclear where this originated from. It was added in the original commit of
this file but, at the time, the Autotools build system was not generating this
variable. The argz functionality seems related to the (now removed) dependency
RxSpencer, but Graphviz never used this and never checked whether it was
available.
fix: emit Bézier curves as point-by-point spline shapes in PIC plugin
With this change, the PIC plugin is finally usable. Bézier curves were being
emitted as a sequence of space-separated numbers. Similar to the previous
situation with boxes, I’m not sure what the intent of this was. This is invalid
PIC syntax. As of this commit, the PIC plugin produces output that is accepted
by GNU PIC. Fixes #131.
fix: print a point array as a point-by-point box in PIC back end
The existing code was emitting the points as a space-separated list of numbers.
It’s not clear what this was attempting to achieve. This is not a valid PIC
command. This change causes this to emit a sequence of line commands to draw the
described box. Related to #131.
This looks once again copied from the core PIC implementation
(lib/common/picgen.c) without accounting for the fact the core implementation’s
attrs macros are generated dynamically. The plugin generates a single macro,
attrs0, which it was incorrectly calling as attrs1. Related to #131.
The PIC plugin seems to have copied some details from the core PIC
implementation (lib/common/picgen.c) without noticing that the core
implementation juggles its comment format to emit PIC comments on pages and only
use TROFF comments at the top level. Related to #131.
pylintrc: backport inclusive language change from Pylint
Pylint commit 850c442dbda8d332049971d5c38f82b86da44f1d modified the pylintrc
template to remove the use of the problematic term “blacklist.” This commit
extracts the relevant parts of that and applies it to our code base, removing
the term in the Graphviz tree as well.
When upgrading to a version of Pylint that includes commit 12a76469782fab5c23d78039c4bfb37e3331945a, we should also swap our usage of
extension-pkg-whitelist for extension-pkg-allow-list.
The lab_gamut_data array is a lookup table (LUT) for some approximation of the
visible gamut of the CIELAB color space.¹ We have previously had extensive
problems compiling this file on Windows due to memory usage of MSVC. 0927817d203d61305da2b019f244744c10b588e6 finally brought things under control by
removing all struct usage which somehow was a factor.
This commit further reduces our requirements and guards against future such
situations. The LUT now, instead of listing every valid CIELAB value, lists
ranges in the CIELAB space. Some numbers:
old new
--------------
file size 8.3MB 149KB
LUT size 2.4MB 43KB
gcc-8.3 -O3 -c lab_gamut.c 5.8sec 0.8sec
max lab_gamut() malloc 18MB 151MB
If necessary, we could reduce the dynamic allocation performed by lab_gamut() by
doing a pre-scan to calculate how many actual CIELAB values we need to store for
a given call.
¹ I say “some approximation” because all my attempts to distill a formula for
deriving this table have failed. The closest is to enumerate the CIELAB
space, translate each color into Standard RGB and then check whether the
resulting value is within (0,0,0) - (255,255,255). However, this still is
not quite exact. I expect the machine on which this LUT was originally
generated uses a differently floating point representation or precision than
any that I have available.
This lookup table contains an approximation of the visible gamut of the CIELAB
color space.¹ While scaling to, e.g., Standard RGB is not linear, it is
continuous. Therefore it follows that if (L=5,a=22,b=6) is visible and
(L=5,a=22,b=8) is visible, (L=5,a=22,b=7) is also visible. This was presumably
an accidental deletion committed in pre-version-control days. Fixes #1974.
This replicates the metric tracking from some other CI jobs for the pylint task.
This should make the number of pylint warnings appear in the metrics section of
MRs, allowing us to track whether MRs increase or reduce the number of pylint
warnings.
sprintf has consistently been in the top ten root causes of vulnerabilities in
low level applications and is generally considered unsafe for any use in modern
code bases. This commit removes the instances of it that are straightforward to
convert to snprintf. Related to #1950.