Skip to content

Commit b0f9003

Browse files
committed
project: bump flake,python, theme: press -> awesome
1 parent 0503f70 commit b0f9003

8 files changed

Lines changed: 200 additions & 76 deletions

File tree

conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@
113113

114114
# The theme to use for HTML and HTML Help pages. See the documentation for
115115
# a list of builtin themes.
116-
html_theme = "press"
117-
html_theme_options = { "body_max_width": 1600 }
116+
html_theme = "sphinxawesome_theme"
117+
html_theme_options = { "body_max_width": 1600 } # "config_file": "theme.toml",}
118118
html_static_path = ['_static', 'code']
119119
html_css_files = [ 'css/s4defs-roles.css', 'css/iframe.css', 'css/admonitions.css' ]
120120

custom.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
.. |bottom| replace:: :math:`\bot`
99
..
1010
GHC Specific
11-
.. |ghcVersion| replace:: 9.2.x
11+
.. |ghcVersion| replace:: 9.x
1212
.. |core| replace:: Core
1313
.. |stg| replace:: Stg

flake.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 56 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,54 +10,81 @@
1010
};
1111

1212
outputs = { self, nixpkgs, flake-utils, flake-compat }:
13-
let press-theme-overlay = final: prev: {
14-
sphinx-press-theme = prev.python311Packages.buildPythonPackage rec {
15-
pname = "sphinx_press_theme";
16-
version = "0.8.0";
13+
let pythonEnv-overlay = final: prev: {
14+
python313Packages = prev.python313Packages.overrideScope (pyFinal: pyPrev: {
1715

18-
src = prev.python311Packages.fetchPypi {
19-
inherit pname;
20-
inherit version;
21-
sha256 = "sha256-KITKqx3AHssR0VjU3W0xeeLdl81IUWx2nMJzYCcuYrM=";
22-
};
23-
propagatedBuildInputs = [ prev.sphinx ];
24-
};
25-
};
16+
# sphinx-press-theme = pyPrev.buildPythonPackage rec {
17+
# pname = "sphinx-press-theme";
18+
# pyproject = true;
19+
# build-system = [ pyPrev.setuptools ];
20+
# version = "0.9.1";
2621

27-
copy-button-overlay = final: prev: {
28-
sphinx-copybutton = prev.python311Packages.buildPythonPackage rec {
22+
# src = pyPrev.fetchPypi {
23+
# inherit pname;
24+
# inherit version;
25+
# sha256 = "sha256-KITKqx3AHssR0VjU3W0xeeLdl81IUWx2nMJzYCcuYrM=";
26+
# };
27+
# propagatedBuildInputs = [ pyPrev.sphinx ];
28+
# };
29+
30+
31+
sphinx-copybutton = pyPrev.buildPythonPackage rec {
2932
pname = "sphinx-copybutton";
33+
pyproject = true;
34+
build-system = [ pyPrev.setuptools ];
3035
version = "0.5.2";
3136

32-
src = prev.python311Packages.fetchPypi {
37+
src = pyPrev.fetchPypi {
3338
inherit pname;
3439
inherit version;
3540
sha256 = "sha256-TPF8gvuWRtG8nKkqwoCBOjtgXYxCEiX9mRMVQQPuH70=";
3641
};
37-
propagatedBuildInputs = [ prev.sphinx ];
42+
propagatedBuildInputs = [ pyPrev.sphinx ];
3843
};
39-
};
4044

41-
sphinx-exec-directive-overlay = final: prev: {
42-
sphinx-exec-directive = prev.python311Packages.buildPythonPackage rec {
45+
sphinx-exec-directive = pyPrev.buildPythonPackage rec {
4346
pname = "sphinx-exec-directive";
47+
pyproject = true;
48+
build-system = [ pyPrev.setuptools ];
49+
4450
version = "0.6";
4551

46-
src = prev.python311Packages.fetchPypi {
52+
src = pyPrev.fetchPypi {
4753
inherit pname;
4854
inherit version;
4955
sha256 = "sha256-lMo4QILqt6pEiIatN/LNxhiUGX3ziSWV+bfRahzmZWU=";
5056
};
51-
propagatedBuildInputs = [ prev.sphinx prev.python311Packages.matplotlib ];
57+
propagatedBuildInputs = [ pyPrev.sphinx
58+
pyPrev.matplotlib
59+
];
5260
};
53-
};
5461

55-
tex-overlay = final: prev: {
56-
tex-env = prev.texlive.combine {
57-
inherit (prev.texlive)
58-
scheme-basic collection-xetex fncychap titlesec tabulary varwidth
59-
framed capt-of wrapfig needspace dejavu-otf helvetic upquote
60-
memorygraphs;
62+
sphinxcontrib-bibtex = pyPrev.buildPythonPackage rec {
63+
pname = "sphinxcontrib_bibtex"; # yes they are inconsistent with the name
64+
pyproject = true;
65+
build-system = [ pyPrev.setuptools ];
66+
67+
version = "2.6.5";
68+
69+
src = pyPrev.fetchPypi {
70+
inherit pname;
71+
inherit version;
72+
sha256 = "sha256-mzIk3W/s6SaOvYyQXcCoP/L2xUFIqSNf5w6dHp/xScA=";
73+
};
74+
propagatedBuildInputs = [ pyPrev.sphinx
75+
pyPrev.pybtex
76+
pyPrev.pybtex-docutils
77+
];
78+
};
79+
});
80+
};
81+
82+
tex-overlay = final: prev: {
83+
tex-env = prev.texlive.combine {
84+
inherit (prev.texlive)
85+
scheme-basic collection-xetex fncychap titlesec tabulary varwidth
86+
framed capt-of wrapfig needspace dejavu-otf helvetic upquote
87+
memorygraphs;
6188
};
6289
};
6390

@@ -66,9 +93,7 @@
6693
(system:
6794
let pkgs = import nixpkgs
6895
{ inherit system;
69-
overlays = [ press-theme-overlay
70-
copy-button-overlay
71-
sphinx-exec-directive-overlay
96+
overlays = [ pythonEnv-overlay
7297
tex-overlay
7398
];
7499
} ;

hoh.nix

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,18 @@
33
}:
44

55
let
6-
pythonInputs = with pkgs.python311Packages; [
7-
sphinx
8-
sphinxcontrib-bibtex
6+
pythonEnv = pkgs.python313.withPackages (ps: with ps;
7+
[ sphinx
98
sphinxcontrib-tikz
109
sphinx-autobuild
10+
sphinxawesome-theme
11+
sphinx-copybutton # this comes from the overlay
12+
sphinxcontrib-bibtex # from overlay
13+
# sphinx-exec-directive
1114
pip
12-
# marked as broken in nixpkgs unfortunately
13-
# sphinx-book-theme
14-
## until we have a reason for tex leave this commented out for CI
15-
];
16-
nonPythonInputs = with pkgs; [ sphinx-press-theme # this comes from the overlay
17-
sphinx-copybutton # this comes from the overlay
18-
# pandoc
19-
# change once extension fixes are upstreamed
20-
sphinx-exec-directive
21-
rst2html5
15+
]);
16+
17+
nonPythonInputs = with pkgs; [ rst2html5
2218
ghc
2319
cabal-install
2420
git
@@ -30,7 +26,7 @@ pkgs.stdenv.mkDerivation {
3026
version = "0.0.1";
3127
src = ./.;
3228
phases = [ "unpackPhase" "preBuild" "buildPhase" "installPhase"];
33-
buildInputs = pythonInputs ++ nonPythonInputs;
29+
buildInputs = [pythonEnv] ++ nonPythonInputs;
3430

3531
preBuild = ''
3632
unset SOURCE_DATE_EPOCH
@@ -40,7 +36,7 @@ pkgs.stdenv.mkDerivation {
4036

4137
buildPhase = ''
4238
runHook preBuild
43-
export PATH="${pkgs.lib.makeBinPath (pythonInputs ++ nonPythonInputs)}:$PATH";
39+
export PATH="${pkgs.lib.makeBinPath (nonPythonInputs)}:$PATH";
4440
SOURCE_DATE_EPOCH="$(${pkgs.coreutils}/bin/date '+%s')"
4541
make clean
4642
make ${target} SPHINXOPTS="-W"

index.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ Haskell Optimization Handbook
55
*by Jeffrey M. Young*
66

77

8-
This book assumes you are using ghc |ghcVersion| or above and using the Linux
9-
operating system. If you are new then the best place to start is the :doc:`How
10-
to use this book </src/Preliminaries/how_to_use>` chapter. If you are returning
11-
then feel free to jump to the :ref:`mastertoc` and best wishes. It is dangerous
12-
to go alone, please take this handbook and good luck!
8+
This book assumes you are using ghc |ghcVersion| and using the Linux operating
9+
system. If you are new then the best place to start is the :doc:`How to use this
10+
book </src/Preliminaries/how_to_use>` chapter. If you are returning then feel
11+
free to jump to the :ref:`mastertoc` and best wishes. It is dangerous to go
12+
alone, please take this handbook and good luck!
1313

1414
Sincerely,
1515

src/Measurement_Observation/Core_Profiling/data_type_memory_footprint.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ A total of 387 words which is 3, 096 bytes or roughly 3KiB, just for 32
465465
elements! Unfortunately, this also will not be a cache friendly data structure.
466466
To store 387 words we need :math:`\frac{387}{8} = 48` cache lines. But 387 is
467467
not a multiple of 2, so there will be :math:`387 \bmod{} 8 = 3` words of
468-
leftover space on the final cache line [#]_. A more cache friendly data
468+
leftover space on the final cache line [#f1]_. A more cache friendly data
469469
structure would ensure that a ``Full`` always fit evenly into a set of cache
470470
lines and would thereby avoid fragmenting the cache. One caveat is that this
471471
wasted space will change depending on the sizes of the key and value.
@@ -731,11 +731,11 @@ Which is just what we expected: one word (``.quad (,)_con_info``) for the data
731731
constructor header, one for ``fst`` (``.quad stg_INTLIKE_closure+273`` ), and
732732
one ``snd`` (``.quad stg_INTLIKE_closure+289``). However, GHC has added another
733733
word that is mysteriously set to 3: ``.quad 3``. This extra word is an
734-
optimization that GHC applies which tags the symbol ``Main.a_pair_closure`` as a
734+
optimization that GHC applies which tags [#f3]_ the symbol ``Main.a_pair_closure`` as a
735735
static constructor that contains no :term:`CAF` references. This tag (the 3)
736736
instructs the garbage collector to ignore this symbol during garbage collection.
737737
If ``Main.a_pair_closure`` was found to possibly have a CAF then the tag would
738-
have been 0 but the extra word would still exist [#]_ . So does this mean that
738+
have been 0 but the extra word would still exist [#f2]_. So does this mean that
739739
our analysis is incorrect? No, this data is only checked and loaded during a
740740
garbage collection event, it is a by product of our abuse of ``NOINLINE`` to
741741
create a static top-level closure.
@@ -1067,18 +1067,18 @@ that data you'll be all but guaranteed to speed up your system.
10671067
References
10681068
==========
10691069

1070-
.. [#] The HashMap behaves this way because of `yours truly
1071-
<https://github.com/haskell-unordered-containers/unordered-containers/pull/317>`__.
1072-
Even though the cache behavior is poor, the 16-bit base was worse because
1073-
it created HashMaps with a more deeply nested structure. This meant even
1074-
*more* pointer chasing in full cases. For the interested, you can observe
1075-
the effect in the data posted in the pull request I have linked.
1070+
.. [#f1] The HashMap behaves this way because of `yours truly
1071+
<https://github.com/haskell-unordered-containers/unordered-containers/pull/317>`__.
1072+
Even though the cache behavior is poor, the 16-bit base was worse because
1073+
it created HashMaps with a more deeply nested structure. This meant even
1074+
*more* pointer chasing in full cases. For the interested, you can observe
1075+
the effect in the data posted in the pull request I have linked.
10761076
1077-
.. [#] The `Haskell Wiki
1078-
<https://www.fpcomplete.com/blog/2016/05/weigh-package/>`_ page. Although
1079-
it has not been updated in some time.
1077+
.. [#f2] The `Haskell Wiki
1078+
<https://www.fpcomplete.com/blog/2016/05/weigh-package/>`_ page. Although
1079+
it has not been updated in some time.
10801080
1081-
.. [#] For the interested, `here
1081+
.. [#f3] For the interested, `here
10821082
<https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/GHC/StgToCmm/Heap.hs?ref_type=heads#L215>`__
10831083
is where the tag is applied and `here
10841084
<https://gitlab.haskell.org/ghc/ghc/-/blob/master/rts/sm/Storage.h?ref_type=heads#L134>`__

0 commit comments

Comments
 (0)